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

0 Members and 1 Guest are viewing this topic.

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

I'm using CWP PRO 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 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).

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.

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 ( 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]Thank you all.