Turn Off PHP Safe Mode In Cpanel

While I was checking the site stats of this blog, I've noticed that some people are looking for ways on how to turn off PHP safe mode in Cpanel. On my previous post, I have mentioned that it can be done on a server-wide setting. But what if you want to disable safe mode on particular domains only on Cpanel?

This can be done by adding a simple line below the httpd.conf entry of that domain.

php_admin_flag safe_mode On


ServerAdmin webmaster@yourdomain.com
DocumentRoot /home/youruser/public_html
BytesLog domlogs/yourdomain.com-bytes_log
User youruser
Group youruser
ServerName http://www.yourdomain.com/
ServerAlias yourdomain.com http://www.yourdomain.com/
CustomLog domlogs/yourdomain.com combined
ScriptAlias /cgi-bin/ /home/youruser/public_html/cgi-bin/
php_admin_flag safe_mode On

On shared hosting accounts, just ask a request from your hosting provider. Most of the hosts are enabling safe mode in PHP for security purposes.



From Dave:

The proper way to do this on cPanel 11 is to edit the configuration file using WHM ( Web Host Manager).

1. Login to WHM.
2. Go into the Service Configuration menu and locate the PHP Configuration Editor.
3. From there you can set the various PHP settings such as disabling SAFE MODE.

For custom modifications of Apache and PHP, please refer to this link:

Bunch of thanks Dave!

Disqus Comments