Posts tagged How to enable custom php.ini settings for particular domain in Plesk

How to enable custom php.ini settings for particular domain in Plesk ?

Most of the time it is observed that a particular domain requires php.ini variables other than those set in the server’s main php.ini file, so it is not possible to change the server php.ini variables for a particular domain. In that case we can enable those custom variables required for a particular domain from the httpd.include file.
To enable this you need to make the required changes :

[email protected][#] cd /var/www/vhosts/yourdomain.com/conf

[email protected][#] vi httpd.include

Search for the Directory tab

8) Directory /var/www/vhosts/yourdomain.com/httpdocs

and here you will find the sapi_apache2.c and mod_php5.c modules entries under the directory tab


php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir “/var/www/vhosts/allbuyart.com/httpdocs:/tmp”


php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir “/var/www/vhosts/allbuyart.com/httpdocs:/tmp”

Now you just need to change/set the variables in those modules

for example if you want to enable the safe_mode on then make the below changes :


php_admin_flag engine on
php_admin_flag safe_mode on
php_admin_value open_basedir “/var/www/vhosts/allbuyart.com/httpdocs:/tmp”


php_admin_flag engine on
php_admin_flag safe_mode on
php_admin_value open_basedir “/var/www/vhosts/allbuyart.com/httpdocs:/tmp”

Then restart the apache service

[email protected][#] /etc/init.d/httpd restart

That’s all you are done.