Custom php.ini with Plesk

By Steven Lloyd Watkin, Wednesday 13th August 2008 3:53 pm

We have a dedicated server with ukFast on which we run a number of domains that exist on virtual servers running under Plesk. Anyway, on most of my domains I want to hide away warnings and for security keep errors to the log files, however on some of my domains (such as those I’m developing on) I want to show every little nasty warning and error that appears.

If I edit my php.ini this affects each and every domain on the server, not a good idea especially when several of the sites are fully live versions  So in order to get around this you need to put a file called vhosts.conf in your conf directory, for example, /var/www/vhosts/<my_domain>/conf/vhost.conf.

Once you’ve added your additional code, again for example I included,

php_value error_reporting E_ALL
php_value display_errors On

followed by running the following command (this reconfigures all of your domains its just quicker lazier than typing in the domain name ,

# /usr/local/psa/admin/bin/websrvmng -a

If you’re feeling a bit nimble then you can always type out the full version which is,

# /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=<my_domain>

After this command if you look to httpd.include file, will see that your httpd.include will have an include line for your vhost.conf, something like this:

Include /srv/www/vhosts/domain.com/conf/vhost.conf

								

Leave a Reply

Panorama Theme by Themocracy

11 visitors online now
11 guests, 0 members
Max visitors today: 11 at 12:09 am UTC
This month: 24 at 01-02-2010 06:04 am UTC
This year: 34 at 25-01-2010 01:46 pm UTC
All time: 34 at 25-01-2010 01:46 pm UTC