Article ID: 129716, created on Oct 28, 2016, last review on Oct 28, 2016

  • Applies to:
  • Operations Automation

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.%';

Search Words

particular version of php

all Apache webspaces

apache_extensions

specific version of php

How to find all Apache webspaces

php version

apache_hostlist

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF