• 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 Question about PHP-Settings (Local and Master Values)

krxl

New Pleskian
Hi guys,

I'm quiet new to plesk, but still got some websites up and running fine. But now I need some help and hope to find it here. :)
Yesterday I set up Nextcloud (Owncloud-Fork) and after the installation I saw some suggestions in the Nextcloud-Webinterface, which told me to do some changes in my php-settings (like enabling caching and so on)
On a info-site Nextcloud reported that my server has its memory_limit set to 512MB, which surprised my, because in my Serviceplan, in my domain-settings and in my subdomain-settings (I have created cloud.domain1.com for nextcloud) this memory_limit is set to 128M. So I started investigating...
I created a php-info file and it displays for me:
memory_limit 512M (local value) 128M (master value)
As far as I understood the local value overrides the master value and this is why nextcloud is displaying the memory_limit with 512MB. So far so good...
As a next-step, I changed the php-settings of my subdomain. I changed the memory_limit from 128M (default) to 129M and after that the php-info showed:
memory_limit 129M (local value) 129M (master value)

Conclusion:
- When I set memory_limit to the default value (128M), the local value is in fact 512M
- When I set it to another value, both (master and local) values will change - this could be the solution, but I want to understand this issue.
- this is the case for all php-settings, not just memory_limit

Questions:
- Where is the setting "memory_limit 512M" coming from?
- Why is it the local value and why is the value that I define in my subdomain-setting not the local value?

Hope someone can help me!

Best regards
 
paths are for centos, my differ in ubuntu or other linux releases

- local value is the value set in the php.ini at domain level and in use for that domain at that moment.
For every php version other the OS vendor php, the local php.ini file is created with the one at the php install as template.
php 7.1 -> /opt/plesk/php/7.1/etc/php.ini
php 5.5 -> /opt/plesk/php/5.5/etc/php.ini

- Master value = the php.ini at /etc/php.ini or compiled in the php
/etc/php.ini is used when the domain, or subdomain, has the OS vendor php version

conclusion: yes local value overrules master value, in phpinfo() the master value is what is in /etc/php.ini or compiled into php, local value is what is changed by the php.ini for that (sub)domain and is in use at that point in time for that (sub)domain.

You can test this by calling 2 phpinfo() in the same page and add some ini_set() commands in between, you will see local value change

PHP: ini_set - Manual

regards
Jan
 
Hi Linulex,

thanks for your answer! I now understand where the PHP-Files are located but I still don't understand plesks behaviour. Maybe it helps if I attach some screenshots.
In plesk_php.png the default value is set (128M). But in php_info.png you can see that the local value is 512M.
In plesk_php2.png I changed the value to something other than the default (127M). In php_info2.png you can see that both values changed to 127M.

In both cases phpinfo says: Loaded Configuration File /opt/plesk/php/7.1/etc/php.ini
In this php.ini the memory_limit is always set to 128M.

I'm running Ubuntu 16.04.2 and I'm using PHP 7.1.4 (since today, before it was 7.1.3)

This seems like a bug to me, doesn't it?

Regards
Stefan
 

Attachments

  • plesk_php.PNG
    plesk_php.PNG
    7.8 KB · Views: 7
  • php_info.PNG
    php_info.PNG
    1.7 KB · Views: 7
  • php_info2.PNG
    php_info2.PNG
    1.5 KB · Views: 7
  • plesk_php2.PNG
    plesk_php2.PNG
    6.3 KB · Views: 7
Back
Top