- Knowledgebase Home
- » Browse by Service
- » (dv) Dedicated-Virtual Server
- » (dv) 3.0
- » Web Applications
- » PHP and Coding
- Knowledgebase Home
- » Browse by Service
- » (dv) Dedicated-Virtual Server
- » (dv) 3.5
- » Web Applications
- » PHP and Coding
- Knowledgebase Home
- » Browse by Service
- » (dv) Dedicated-Virtual Server
- » (dv) 4.0
- » Web Applications
- » PHP and Coding
- Knowledgebase Home
- » Browse by Service
- » (dv) Dedicated-Virtual Server
- » (dv) 3.0
- » Server Settings and Optimization
How can I turn off safe_mode on an (dv) Dedicated-Virtual Server with Plesk?
For a discussion of Safe Mode and security, please see PHP Safe Mode, problems and work-arounds first.
Disable Safe Mode globally in SSH
You can edit your php.ini file to disable Safe Mode for all domains:
- Log into your server as a root or sudo user via SSH.
-
Open your php.ini file for editing:
vi /etc/php.ini -
Edit this line:
Filename: php.ini
safe_mode = OnTo this:
Filename: php.ini
safe_mode = Off
vi tip:
Type "/" and a search string, then hit enter to search for a particular phrase in a long file. Press "i" to enter "insert mode" so you can type and copy/paste. Press "Esc" to exit "insert mode" when you are done modifying the file. Type ":wq" to save and quit.
-
Restart Apache:
/etc/init.d/httpd restart
One-liner alternate method
- Log into your server as a root or sudo user via SSH.
-
Execute the following command:
perl -p -i -e 's/^safe_mode\s*=\s*on/safe_mode =off/i;' /etc/php.ini -
Restart Apache:
/etc/init.d/httpd restart
Disable Safe Mode for individual domains in Plesk
Test
You can verify that safe mode is off on your phpinfo.php page.
User Comments
No visitor comments posted. Post a comment
Fields marked with an asterisk(*) are required. Comment on this article


