Is there any way to customize
php.ini for newly created websites?
There is no such functionality to use one
php.ini for all service nodes since every service node has its own
php.ini file depending on PHP version and operating system. Moreover, every custom PHP handler has own
When a new website is created in Customer Control Panel, the PHP settings are taken from corresponding
php.ini, which depends on PHP handler. The following command illustrates which
php.ini file is used along with a PHP handler (the command is run on the management node):
# /usr/local/psa/bin/php_handler --list -service-node 172.16.0.11 id: display name: full version: version: type: cgi-bin: php.ini: cgi 5.3.3 5.3.3 5.3 cgi /usr/bin/php-cgi /etc/php.ini fastcgi 5.3.3 5.3.3 5.3 fastcgi /usr/bin/php-cgi /etc/php.ini module 5.3.3 5.3.3 5.3 module /usr/bin/php-cgi /etc/php.ini php563 php5.6 5.6.3 5.6 fastcgi /usr/local/php563/bin/php-cgi /usr/local/php563/php.ini
In this example, once PHP handler with ID
php563 is selected in CCP > Wesites > Hosting Settings for the website
example.com, the file
/var/www/vhosts/system/example.com/etc/php.ini is generated from the
/var/www/vhosts/system/example.com/etc/php.ini is being reset to default values every time the website settings are saved no matter whether any changes were made.
To avoid that the PHP settings should be customized in control panel CCP > Websites > example.com > PHP Settings.
Note: On IIS service nodes
php.ini files can be found at the following locations:
- for PHP 4.4:
C:\Program Files (x86)\Parallels\Plesk\Additional\PHP\
- for PHP 5.2:
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5
- for PHP 5.3:
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP53
- for PHP 5.4:
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP54
Refer to the article KB123679 in order to learn how to install and register custom PHP handler on Apache service node.