PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, March 2, 2022

[FIXED] Trouble changing `upload_max_filesize` on nginx

 March 02, 2022     nginx, php, wordpress     No comments   

Issue

I've see a few other similar questions on here, but most of the answers are Apache specific (dealing with their .htaccess file) and I'm using nginx.

I'm having trouble making my change to the upload_max_filesize in php.ini stick. I'm using nginx, php5 and wordpress on Debian.

When I run phpinfo() I see the following output:

Loaded Configuration File /etc/php5/cgi/php.ini

I then go to the relevant .ini file, change a few values, and then restart nginx. When I fire up a phpinfo() plugin I got for wordpress, it reports the values as unchanged.

I'm at a loss because phpinfo() reports that it is loading config values from the file that I've changed, but it doesn't report the changes.


Solution

You might be using FAST CGI:

[webserver] <----> [fcgi daemon]
                        `- [php]

If you restart the webserver, PHP is not restarted, so still has the old ini values because it didn't reload the ini file.

Restarting the fcgi daemon solves that issue, PHP will be restarted, re-reading the ini.

Some fcgi daemons have a command that reloads the child processes more gracefully. Depends on what you use.



Answered By - hakre
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing