Author Topic: Changes in PHP.INI won't work!  (Read 6404 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
Changes in PHP.INI won't work!
« on: February 05, 2019, 08:16:55 AM »
Hi,


I'm using CWP PRO 0.9.8.763 and my server is configured to use NGINX+APACHE+VARNISH+PHP-FPM, and I was trying to increase upload_max_size for a user. I've tried the following:
1. Adding a php.ini file - didn't work.
2. Editing php.ini within the user's CWP panel - didn't work.
3. Deleting php.ini caused the panel to create a default php.ini, yet - didn't work.
4. I've found an answer here that since 0.9.8.742 we should use .user.ini instead of php.ini - didn't work.
5. Putting this .user.ini in wp-admin folder - didn't work.
6. Putting php.ini in wp-admin folder - didn't work.
7. Another answer here said something about a trailing slash after localhost - but mine didn't have this slash.


So... why do we have to guess? Why for instance the definitions for php.ini the user sets in his panel won't work. Even the definitions under PHP Settings -> PHP Simple Editor in the main CWP panel won't change anything.


I'm really puzzled where I can change this php settings either globally or per user (preferably per user).

Offline
**
Re: Changes in PHP.INI won't work!
« Reply #1 on: February 05, 2019, 02:27:45 PM »
PHP-FPM uses a different file.

Put .user.ini (note the 2 dots) in public_html with your declarations in it. If it doesn't work for WordPress move the file to wp-admin folder.

http://php.net/manual/en/configuration.file.per-user.php

Offline
**
Re: Changes in PHP.INI won't work!
« Reply #2 on: February 06, 2019, 01:31:41 PM »
Well, I think I got it all figured out.
While I was expecting the changes to take effect immediately, it seems there's a cache defined in user_ini.cache_ttl (300 in my case) in seconds.


After a change I made in the file, I had to leave the computer for a few minutes. After I got back, I saw the change took place. That's when I figured out there must be a cache issue and found this setting.


So, I think the wiki (http://wiki.centos-webpanel.com/php-ini-per-folder) has to be updated with the following:
A. Newer versions of CWP are now using .user.ini instead of php.ini (by the way, Wordfence is using .user.ini as well).
B. You'll have to wait the amount of seconds mentioned in user_ini.cache_ttl for the change to take effect.
[/size]
[/size]Thank you all.