How do I enable custom php.ini for particular virtual host?

Created:

2016-11-16 12:46:29 UTC

Modified:

2017-04-24 11:12:45 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How do I enable custom php.ini for particular virtual host?

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 10.3 for Linux

NOTICE

If you have domain with CGI/FastCGI mode of PHP some of values will be taken from /var/www/vhosts/DOMAINNAME/conf/php.ini file despite of settings defined in Plesk interface. Thus priority of receiving settings for custom php.ini is following:

server-wide php.ini < PHP setting defined for the domain in the Plesk GUI < domain's conf/php.ini

You can find more details in chapter Applying Custom PHP Settings on Domains with PHP in CGI/FastCGI Mode of Advanced Administration Guide for Linux

Resolution

Since the release of version 10.3, Parallels Plesk Panel for Unix allows one to enable the per-vhost php.ini configuration file when PHP runs in CGI or FastCGI mode.

The file is loaded from the following virtual host etc directory (for 10.3 - 11.0):

/var/www/vhosts/DOMAINNAME/etc/php.ini

or (for 11.5) at:

/var/www/vhosts/system/DOMAINNAME/etc/php.ini

And please note that applying these changes for 11.5 will require SSH root access - it will not possible to perform this via File Manager.

To enable virtual host-specific PHP configuration, open the Control Panel of the client to whom the domain belongs:

Go to the "Websites & Domains" tab, select the domain, enter its Hosting Settings, and switch PHP mode to FastCGI or CGI:

Have more questions? Submit a request
Please sign in to leave a comment.