• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question PHP values are getting reset to default values

mr-wolf

Silver Pleskian
Plesk Guru
The PHP-values of upload_max_filesize / post_max_size / max_input_time / max_execution_time & memory_limit need to be higher for a certain site than the default values.

Repeatedly I'm getting called by a customer that he's incapable of doing certain things and when I examine the PHP-values I can see they are reset to their default values.
This has happened so often that I know for sure that these values were set higher in the past.

This is the kind of thing we have Plesk for.
Easy management and clear display of the values currently being used.

I will now think about some way to monitor these with Zabbix so I can see when these change again.
Maybe I will use the Plesk CLI command for this.

If others are using Zabbix and are interested I will publish these.
I created a report already about Plesk not migrating certain PHP-values (at least short_open_tag), but this is a site that's been on that server for 2 years.

To be continued.....

The plot thickens...
I started to work on what should become a way of monitoring the PHP-values of certain subscription with Zabbix and used the command

/usr/local/psa/bin/subscription_settings --show-php-settings xxxxx.com
General settings:
open_basedir = {WEBSPACEROOT}{/}{:}{TMP}{/}
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
short_open_tag = on
Performance settings:
PHP-FPM settings:
pm.max_children = 50
pm = ondemand
Additional directives:


That is my only output.
Although all the performance values are changed....
Am I missing something???
Need to examine this further to get it all...

EDIT...
Better look in the horse's mouth in /var/www/vhosts/system/xxx.com/etc/php.ini


It is not that difficult to get the values from there, but to template it in Zabbix is another story.

But I don't really need to make something new in Zabbix to see any PHP-change server-wide....
I already wrote the function latestfilename that I can use in this way:

latestfilename /var/www/vhosts/system/ 3 php.ini

It will return the name of the youngest file with that spec (in that folder, up to 3 levels deep with name php.ini)


This has become the trigger in Zabbix and I will come back when I have more info

Description: {ITEM.LASTVALUE1} is now the youngest php.ini (younger than $2) in /var/www/vhosts/system/*/etc/

Trigger: {Template_Plesk:latestfilename[/var/www/vhosts/system/,3,php.ini].diff(0)}>0 or {Template_Plesk:latestfileage[/var/www/vhosts/system/,3,php.ini].last(0)}<4h
 
Last edited:
Back
Top