Search Engine: Elastic

Article ID: 128732, created on Apr 24, 2016, last review on Apr 24, 2016

  • Applies to:
  • Plesk Automation 11.5


How to update PHP settings of all websites in Plesk Automation?


On the Linux Apache nodes website-specific php.ini (which reside at directories like /var/www/vhosts/system/ is generated from the corresponding php.ini file provided by current PHP handler used by the website. These php.ini file locations can be viewed by the command below (execute the command on the management node):

[root@mnode ~]# /usr/local/psa/bin/php_handler --list -service-node
    id:  display name:  full version:  version:    type:           cgi-bin:        php.ini:  custom:
    cgi          5.3.3          5.3.3       5.3      cgi   /usr/bin/php-cgi    /etc/php.ini    false
fastcgi          5.3.3          5.3.3       5.3  fastcgi   /usr/bin/php-cgi    /etc/php.ini    false
 module          5.3.3          5.3.3       5.3   module   /usr/bin/php-cgi    /etc/php.ini    false

in the example above the file /etc/php.ini is used by default PHP handler on the service node

On Windows IIS nodes websites do not have their specific php.ini files, so they use global php.ini files which depend on PHP version. These php.ini files can be found at C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5x directories.

In order to apply server-wide PHP settings such as disable_functions directive, the following steps are needed:

  1. Add the directive to all used php.ini files on every web service node
  2. Update PHP settings for every website from the global PHP configuration

For IIS nodes:

  1. Customize global php.ini files at the directories C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5x on the IIS service node
  2. Recycle all application pools to apply new PHP settings immediately:

    2.1 Run Power Shell command prompt as Administrator

    2.2 Issue the command below:

    & $env:windir\system32\inetsrv\appcmd list apppools /state:Started /xml | & $env:windir\system32\inetsrv\appcmd recycle apppools /in

For Apache nodes:

  1. Customize global php.ini files used by PHP handlers on the Apache node

  2. Find the ID of the node in PSA database:

    # mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "select id,ipAddress,externalId from ServiceNodes"
    | id | ipAddress    | externalId |
    |  1 | local        | 1          |
    |  2 |  | 3          |
    |  4 |  | 6          |

    here id is the ID that will be used in the further queries and externalId is the service node ID displayed in the provider panel at Infrastructure > Service nodes

  3. Generate a list of the domains running on the node (execute on the management node):

    # mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -sNe "select name from domains where id in (select dom_id from DomainServices where ipCollectionId in (select ipCollectionId from IpAddressesCollections where ipAddressId in (select id from IP_Addresses where serviceNodeId = 2)))" > node_3_domains.txt

    In this example query the service node has ID 3 in provider panel, but its internal ID is 2

  4. Apply PHP settings to the domains in the list by running the command below on the management node:

    # while read sub; do /usr/local/psa/bin/subscription --update-php-settings $sub; done < node_3_domains.txt

e0aff7830fa22f92062ee4db78133079 caea8340e2d186a540518d08602aa065 33a70544d00d562bbc5b17762c4ed2b3

Email subscription for changes to this article
Save as PDF