Disabling PHP’s safe_mode on Plesk

January 17th, 2007

In Plesk, you can disable on a per-domain basis PHP’s safe_mode. Before doing this though, be advised that disabling safe_mode could lead to security risks for all of your domains on the server.

On the following steps, replace to your domain as needed.

To configure safe_mode usage, edit or create the file:
/home/httpd/vhosts/<domain-name>/conf/vhost.conf

The contents of the file should be something like:
<Directory /var/www/vhosts/<domain-name>/httpdocs>
Options +FollowSymLinks
<IfModule sapi_apache2.c>
php_admin_flag safe_mode Off
</IfModule>
</Directory>

Note that you can not edit /home/httpd/vhosts//conf/httpd.include as it overwritten by Plesk so all your changes would be lost if put there.

For the changes to take effect, you need to run the following:

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain_name>

And then, reload Apache’s configuration with:
service httpd reload

Tested under Plesk 7.5.4.

Entry Filed under: PHP, Plesk

Leave a Comment

You must be logged in to post a comment.

Trackback this post  |  Subscribe to the comments via RSS Feed


Most Recent Posts