affiliate_link

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

Output:

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.

Goodluck!

Edit:

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:
http://www.cpanel.net/support/docs/ea/ea3/

Bunch of thanks Dave!

Recommended buys!

3 comments

  1. Anonymous  

    April 16, 2008 at 11:32 PM

    It should be noted that when running cPanel 11, you should not directly edit httpd.conf.

    Instead, use the PHP Configuration Editor in the Service Configuration menu in WHM to change PHP settings such as disabling Safe Mode.

    If you wish to make custom modifications to Apache or PHP and even push those changes across multiple servers, documentation is available here: http://www.cpanel.net/support/docs/ea/ea3/

  2. adminix  

    April 17, 2008 at 11:53 AM

    Thanks Dave for the quick info! I'll be editing the above post and will include your comment for the benefit of all cPanel administrators.

    Thanks again.

    Cheers,

    Lyz

  3. adminix  

    April 17, 2008 at 12:04 PM

    Done! :)