• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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