| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | [RESOLVED] Disable MySQL In A Script? [RESOLVED] Hey, Okay, i need a way in PHP to disable MySQL access for the rest of the script. Users will be allowed to upload their scripts and i would like to execute them for reasons i'm not going to reveal yet But i need to obviously secure it best i can so is there any way to disable MySQL access, so as to kinda run in sandbox mode?
__________________ -Beaver6813.com V5 Soon! Last edited by beaver6813; 01-05-2007 at 11:17 AM. |
| |
| | #2 (permalink) |
| NamePros Regular | at the top of all the scripts PHP Code: I'm not sure if that would work though, just a thought: http://uk.php.net/features.safe-mode Lee
__________________ http://bypasstopsite.com - Submit your proxy! http://biggertwitter.com - Make twitter a bit bigger! Currently Developing - Linux Screenshots |
| |
| | #3 (permalink) |
| NamePros Regular | if you have apd installed, http://ca.php.net/manual/en/ref.apd.php , you can use the following method of disabling the functions you wish: for example: PHP Code: etc etc... but besure to disable the mysqli functions as well if they are applicable. Also if you don't want to lose functionality of the functions for yourself you can use rename_function to rename the functions to a secure name for your use. for example PHP Code:
__________________ Chimps.ca - Swans.ca - Snails.ca |
| |
| | #4 (permalink) |
| NamePros Regular | Brilliant Ill give rep in a sec Okay another incredibly annoying feature i can't get to work is that when i use my error handler in PHP it works fine with registering the first error, but doesn't pickup the others and it doesn't pickup parse errors, PHP overrides my error handler for parse errors. Any ideas?
__________________ -Beaver6813.com V5 Soon! |
| |
| | #5 (permalink) | |
| Senior Member | Not sure why it would only do the first error however. An error handler cannot deal with parse errors as they are found before the script is executed and is outside the scope of the script. The following is taken from THIS manual page:- Quote:
| |
| |
| | #6 (permalink) |
| NamePros Regular | Okies, so there is definately no way around that? So it returns all parse errors instead of just the first one found?All i'm doing at the moment is picking up errors and setting error_log to write all errors to a text file which i can read at a later date. However even when i put in 3 errors like unclosed brackets and unterminated lines etc it still shows only one of the errors...
__________________ -Beaver6813.com V5 Soon! |
| |
| | #7 (permalink) | |
| Senior Member | sorry edited my post must have been just after you replied. As far as I am aware there is nothing you can do about reporting parse errors. I believe it is the zend engine that actually deals with the following errors:- E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, E_STRICT Hence why a custom error handler cannot deal with them. Quote:
| |
| |
| | #10 (permalink) | |
| NamePros Regular | Quote:
I've also taken a peek at a debugger written in C++ that actually taps straight into PHP's Zend engine, but i doubt i'd be able to do that in PHP :P
__________________ -Beaver6813.com V5 Soon! | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |