Hi, I need to change safe_mode to off and my host will not do it for obvious reasons. But i have been reading that i can use a custom php.ini file to resolve this? Can anyone shed some light on how i would go about doing this? Cheers, Adam
http://php.net is your friend and knows far more than anyone you find on forums http://uk2.php.net/safe_mode In the first table it quite clearly states that safe_mode is only changable by PHP_INI_SYSTEM, settings that can be changed from any php.ini will have the flag PHP_INI_ALL or similar.......if you could change it, it would void the safe mode feature entirely. What exactly do you need safemode disabled for ?? Perhaps there is a code workaround ???
Thank you for your fast reply. I bought a stock image script from http://www.easyphotostore.com which when i installed had some errors see here: www.wishbank.co.uk i went back to the company i bought from and they said that i need safe mode off? Which i thought was weird but obviously the hosting company will not turn off so i don't know what to do now. Cheers, Adam
send me the code, I'll make it work and send it back, or send me a login and I'll do the same ..... the writers are being lazy, they should work around every feature of php and safe_mode is commonly used in thier target environment, you should let me fix it and embarras them by sending it back - ppl hate to have thier jobs done for them, even those too lazy to do thier own jobs in the first place.... without looking comment out line 4 and chmod /home/wishbank/public_html/templates_c to 777
TO answer the original question.. You need to: 1) find the system php.ini script. Easiest way is to use phpInfo(); part of the information will be the location of the INI script. 2) Copy it into your script root for this script. 3) Edit the File, change register globals to "on" 4) Save and copy the php.ini file to EVER directory that's going to be running php for this script. No, It's not a good idea, but sometimes it has to be done to get stuff working. -JasonR
Safe mode CANNOT be affected by any php.ini except the system one, it doesn't matter what you put in your working directory it will be ignored or cause 500 errors
That is simply not true. PHP can be configured to allow or dissallow such overrides, but I know for a fact IT can be overridden to allow register globals unless PHP is specifically configured to dissallow the setting to be changed. If you would like to see an example let me know I'll set up a phpInfo page that shows the system setting, and the local setting. It is important to note that the custom php.ini must be in EVERY directory that you want it to take effect for. It does not cover subdirectories. -JasonR
Dude, read the post properly, we're not even talking about register_globals, we're talking about safe_mode ..... I certainly don't need to see any examples, lol .......