PHP settings not changing
Having a strange issue with the PHP settings on one of our cPanel servers.
None of the settings changed by editing the php.ini file (/usr/local/lib/php.ini) or by the WHM interface (PHP Configuration Editor) are making any changes to PHP.
Using suphp handler.
Looks like the default settings only are being used for PHP.
Have tested this by running phpinfo(); and checking results from this against what is set in the php.ini file and the PHP Configuration Editor settings.
main 2 things I want to change and what I have been comparing:
upload_max_filesize
post_max_size
(is the default for these 8M and 2M respectively?)
Should I just rebuild PHP or is there some settings I need to check/change to get this working?
-
Hello :) Check to see if an individual php.ini file is uploaded to the account, as local php.ini files are supported with suPHP. You could also open the phpinfo file and review the path utilized for the php.ini file to determine which one is in-use. Thank you. 0 -
Yeah, have checked that, it does not matter if a local php.ini file is present in an account's public_html folder or if there isn't and the system php.ini file is being used. The path of the php.ini file gets updated in the phpinfo, but no other setting changes. So, if no file in account, phpinfo displays the loaded configuration file as: /usr/local/lib/php.ini. or, if present, it displays the loaded configuration file as the php.ini file in the account. But, it does not actually read or get the settings from the php.ini file. The attributes for the settings do not change regardless of what is set in the php.ini file specified. 0 -
We often forget the basic things.. Did you restart Apache? Can you post the output of: php -i | grep 'post_max_size\|upload_max_filesize' If it displays correctly, most probably Apache was not restarted or it failed to restart gracefully. 0 -
Hello :) Feel free to open a support ticket using the link in my signature if restarting Apache does not help. You can post the ticket number here so we can update this thread with the outcome. Thank you. 0 -
OK, output from php -i | grep 'post_max_size\|upload_max_filesize' : post_max_size => 8M => 8M upload_max_filesize => 2M => 2M Apache has been restarted. I'll log a ticket and let you know. Thanks. Also: Further steps taken thus far: I could confirm that command line PHP(php-cli) shows a different output than what its own php.ini states. Attempted an strace on the php command to see if its parsing additional ini files, but did not find any. ####### [/home/.../public_html]# strace -o /root/dump.txt php -i|grep -i loaded Loaded Configuration File => /usr/local/lib/php.ini libXML Loaded Version => 20900 [/home/.../public_html]# cat /root/dump.txt|grep -i ".ini" getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0 open("/usr/local/bin/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/php.ini", O_RDONLY) = 3 lstat("/usr/local/lib/php.ini", {st_mode=S_IFREG|0644, st_size=37476, ...}) = 0 write(1, "Configuration File (php.ini) Pat"..., 33) = 33 write(1, "/usr/local/lib/php.ini", 22) = 22 write(1, "Additional .ini files parsed", 28) = 28 write(1, "user_ini.cache_ttl", 18) = 18 write(1, "user_ini.filename", 17) = 17 write(1, ".user.ini", 9) = 9 write(1, ".user.ini", 9) = 9 ####### I also changed the handler to DSO and set it back to suphp, but no joy there either. 0 -
Please ensure you post the ticket number here so we can update this thread with the outcome. Thank you. 0 -
Ran Easyapache and re-compiled PHP and Apache. Still the issue remained. Referred this issue to the provider who completed further testing and provided the following information: Checking the trace results for the PHP binary, I could confirm that the configuration file is being opened by the PHP binary. However, the results were defaulting to some built in values which I was unable to find. Possibly these values are binary hard coded. Comparing the trace results to a working cPanel server, I could find errors after the configuration file was being read. However, I could not confirm where exactly the error was. The Reolution: - Backed up the current configuration. - Restored the default configuration file from PHP website. - Tested that changes are now being reflected correctly: successful. So currently the default configuration file is the PHP provided default. Will now change to our preferred settings via WHM PHP editor, which is now working. 0 -
I am happy to see the issue is now resolved. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
8 comments