• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

Question Query to check PHP settings for domains

nuno.pereira

New Pleskian
Server operating system version
CentOS Linux release 7.9.2009 (Core)
Plesk version and microupdate number
Plesk Obsidian Version 18.0.46
Hi all.

According to the article in https://support.plesk.com/hc/en-us/articles/115001152233, the PHP settings can be changed in domain, service plan or globally.

I'm trying to figure out a way to determine what is the configuration of disable_functions in the PHP settings for all of my domains.
This parameter settings can be updated in the "Performance and security settings" group, or can also be changed in the Additional configuration directives (which takes precedence over the former).

With the following query I can get the configuration of this parameter (in table PhpSettingsParameters) and of additional parameters (table PhpSettingsCustom), but only from what's defined for the subscription. If the settings are updated on the domain I can't find them.
SQL:
select
d.name, psp.id, psc.value custom_value, psp.value param_value
from
domains d, Subscriptions s
LEFT JOIN SubscriptionProperties sp ON (s.id=sp.subscription_id and sp.name='phpSettingsId')
LEFT JOIN PhpSettingsCustom psc ON (psc.id = sp.value and psc.`value` like 'disable_functions=%')
LEFT JOIN PhpSettingsParameters psp ON (psp.id=sp.value AND psp.`name` = 'disable_functions')
where
d.status = 0 AND
d.id=s.object_id and s.Object_type='domain'

Does anyone knows how to get this configuration, no matter where it was defined?

Thak you in advance.
 
Have you tried to use command:

# plesk bin subscription_settings --show-php-settings domain.tld | grep disable_functions

?
 
I haven't. That kind of works, but I want to know the configuration for all the domains.
Isn't there a way to do it in DB query?
 
Try something like this:
Code:
 #  for domain in $(plesk bin site -l); do plesk bin subscription_settings --show-php-settings $domain | grep disable_functions; done
 
I haven't. That kind of works, but I want to know the configuration for all the domains.
Isn't there a way to do it in DB query?
disable_function value can be found in PhpSettingsParameters table. But unfortunately, there is no direct relevance with domain or subscription ID in that table.
So the id there is just a unique number to match one setting from another.
So PhpSettingsParameters.id = PhpSettings.id; in PhpSettings there is a colum "noteId". PhpSettings.noteId = Notes.id.
And from "Notes" there is a reference to "Templates": Notes.id = Templates.note_id.
And only from there you can associate with "PlansSubscriptions" or "Clients" tables where you can fetch subscriptions or domains.
 
disable_function value can be found in PhpSettingsParameters table. But unfortunately, there is no direct relevance with domain or subscription ID in that table.
So the id there is just a unique number to match one setting from another.
So PhpSettingsParameters.id = PhpSettings.id; in PhpSettings there is a colum "noteId". PhpSettings.noteId = Notes.id.
And from "Notes" there is a reference to "Templates": Notes.id = Templates.note_id.
And only from there you can associate with "PlansSubscriptions" or "Clients" tables where you can fetch subscriptions or domains.
It does not work, as all PhpSettings.noteId are set to 0, and Notes table is empty.
 
Try something like this:
Code:
 #  for domain in $(plesk bin site -l); do plesk bin subscription_settings --show-php-settings $domain | grep disable_functions; done
That's a good way for it, if I don't find a better one. Actually I just need for the active domains, but that I can figure out.
The bigger problem is that's slow, but I only need to do checks once in a while.
 
Back
Top