Increasing PHP file upload size


Just a walk through of something that took me 3 minutes longer than it should have 🤔  Uploading a file via a PHP script was throwing an error. The culprit: upload_max_filesize was set to the default 2M in /etc/php.ini. (Tip: Use phpinfo() to determine the Loaded Configuration File, against the possibility there’s more than one on the system.)

Once you tweak php.ini, restart the PHP FastCGI Process Manager, if that’s how PHP is running on the system (it is, at least on the Rocky Linux 9.7 box this service was running on):

systemctl restart php-fpm.service

And, Bob’s your uncle. (When I was a freshman, you just had to restart Apache ... 🤣)

Comments