• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

PHP version site is using from command line

JayHoll

New Pleskian
Hello,

I have registered multiple versions of PHP in Plesk. I would like to know if there is a command to figure out which version of PHP a site/webspace is using? If I can get the php handler ID, that would be fine too. Does anyone know if there is a command to do this? Subscription, admin, and subscription_settings don't appear to provide this info for the domain.

Thanks,
Jay
 
I dont have a direct answer, but I am guessing this information is available in the PSA mysql database. What I would do is run:

mysqldump --skip-extended-insert -uadmin -p`cat /etc/psa/.psa.shadow` > /root/dump1.sql
then edit the PHP version of 1 subscription, and run again:
mysqldump --skip-extended-insert -uadmin -p`cat /etc/psa/.psa.shadow` > /root/dump2.sql

Then run diff /root/dump1.sql /root/dump2.sql and see which row is different.
 
Thanks for the idea Tozz. Looks like the PHP version isn't saved in the PSA database after all. Diff returned no change. The only way I can see to get this is:

$ grep "SetEnv PP_CUSTOM_PHP_CGI_INDEX" /var/www/vhosts/system/domain.com/conf/last_httpd.conf | awk '{print $3}'

Which will return the handler. My custom handlers have the PHP version in the name, so that will have to do for now.

Would be nice to have this saved in the database and returned via the 'subscription' command.
 
Hmm, perhaps IgorG can shed some light on this, because there must be another location where this data is saved. The file last_httpd.conf is generated by Plesk, and I was under the impression that all Plesk configuration is saved in MySQL database.

But I think using your solutions works equally good, at the end you have the information you want ;)
 
Back
Top