Question

How to find all Apache webspaces on the installation that use the specific version of PHP?

Answer

Run the following command on management node to log in OA database. For OA 6:

# psql -Uplesk -h`hostname` plesk

For OA 7:

# psql -Uoss -h`hostname` oss

Use the following query to determine all Apache webspaces use the particular version of PHP:

plesk=> select ah.homedir_id as webspace_id, ae.name as php_version, ah.path_to_php from apache_hostlist ah inner join apache_extensions ae on ah.service_id = ae.service_id where ah.path_to_php = ae.value and ae.type like 'php%version' and ae.name like '5.%';

In order to calculate the total number of webspaces use the exact version of PHP, use this query:

plesk=> select count (*) from apache_hostlist ah inner join apache_extensions ae on ah.service_id = ae.service_id where ah.path_to_php = ae.value and ae.type like 'php%version' and ae.name like '5.%';

Internal content