Page 1 of 1
Turn off safe_mode in the php.ini
Posted: Sat Jun 16, 2007 2:54 pm
by michslle
Hi, does anyone knows how to turn off safe_mode in the php.ini?
I cannot even find any php.ini in my server, do you know where i must look for?
I read in articles, saying:
To Turn off PHP "safemode" on Your Linux Virtual Dedicated Server
1. Using SSH, connect to your server.
2. Once you are logged in, type su -.
3. For your password, type the same password you used to connect to your server.
4. At the command prompt type: vi /etc/php.ini
6. Go to the line safe_mode = on and press the "i" key.
7. Change the line to safe_mode = off and press the "Esc" key.
8. Type :wq and press Enter to save your file and quit vi.
I have access to etc but i cannot find any php.ini in it...
Please kindly help, i need this urgently.
Posted: Sat Jun 16, 2007 3:18 pm
by bdlang
/etc/php.ini is a possible location, but more likely it's under
/usr/local/php/lib/php.ini or possibly
/etc/httpd/php.ini
Since you seem to have access to the command line via SSH and can operate as root, try these commands:
prompt#
locate php.ini
That should tell you right away, if it doesn't, locate the php binary:
prompt#
which php (to essentially check if the php binary is in your PATH and where it might be found)
prompt#
php --ini
Barring that, list the
/etc directory and see if there is an '
httpd' or '
apache' directory there, search those paths. Also look under /usr/local, another likely place for a PHP installation.
Oh, one other option, create a phpinfo() script and check the output from that:
Posted: Sat Jun 16, 2007 3:28 pm
by michslle
Thank very much for your reply. But I am unable to see /usr/local/php/lib/php.ini and /etc/httpd/php.ini. And do not have access to SSH too.
And I did phpinfo(), it says
safe mode for Local Value -> On
safe mode for Master Value -> Off
Is there a way to turn off the local value?
Posted: Sat Jun 16, 2007 3:54 pm
by bdlang
Hmm. Based on your first post, you seem to indicate that you have console access to this server; at any rate, I was directing you to view the output from phpinfo() so you could see where the php.ini file exists. (under '
Loaded Configuration File').
Anything you want to know can surely be found in the
PHP Manual sections on '
Safe Mode' and '
php.ini directives'.
These indicate that you can only alter safe mode options in the php.ini or httpd.conf configuration files. What would the purpose be if you could alter these directives as a normal user?
Solved
Posted: Sat Jun 16, 2007 5:23 pm
by michslle
Thanks very very much for your help, really appreciate you alot.
Solved it, i was using Plesk control panel.
If you click on the url, and select Group Action, you will be able to find the safe mode can be turned off or on .
Thank again.
Can you tell howm you made this solve?
Posted: Sat Jul 21, 2007 1:24 pm
by aziz
Hello,
I am facing same problem so please tell me which way you made it solve?
Thanks,
Aziz Rattani
Re: Solved
Posted: Sat Jul 21, 2007 5:21 pm
by Ollie Saunders
michslle wrote:Solved it, i was using Plesk control panel.
ewww
I am facing same problem so please tell me which way you made it solve?
Did you read the thread history?
Posted: Sat Jul 21, 2007 9:28 pm
by AKA Panama Jack
And why in the world are you wanting to run with Safe Mode off?
{shudders}
Posted: Sun Jul 22, 2007 2:59 am
by stereofrog
Perhaps for the same reason people turn register globals or magic quotes off: it causes more problems that it attempts to solve. And it will be removed in php6.
Posted: Sun Jul 22, 2007 8:52 am
by The Phoenix
AKA Panama Jack wrote:And why in the world are you wanting to run with Safe Mode off?
{shudders}
Because Safe Mode is false security.
http://ilia.ws/archives/18-PHPs-safe_mo ... urity.html
Posted: Sun Jul 22, 2007 1:12 pm
by Benjamin
AKA Panama Jack wrote:And why in the world are you wanting to run with Safe Mode off?
And why in the world would you want to run with Safe Mode on?