Changing upload_max_filesize in php.ini is not working

Changing upload_max_filesize in php.ini is not working

by Walter Byrd -
Number of replies: 1

I have a Moodle 3.7.7 installation on my home server.

I am using lighttpd as my web server.

When I tried to restore a 5.4MB course, I got the error message: "The uploaded file exceeds the upload_max_filesize directive in php.ini."

Looked for my php.ini file and got this:

# find / -name "php.ini" -print
/etc/php/7.3/apache2/php.ini
/etc/php/7.3/fpm/php.ini
/etc/php/7.3/cli/php.ini
/etc/php/7.0/apache2/php.ini
/etc/php/7.0/cli/php.ini

The logical choice is /etc/php/7.3/fpm/php.ini. I removed apache2 from my system. But, to be sure , I edited all of those files. In each file I changed upload_max_filesize = 2M

to

upload_max_filesize = 20M

Then I restarted lighttpd

# /etc/init.d/lighttpd restart
[ ok ] Stopping web server: lighttpd.
[ ok ] Starting web server: lighttpd.

Kept getting the same error.

Tried closing the tab I was using for my site. The opened another tab and reloaded. Tried logging out, and logging back in. Nothing seems to work, I keep getting that error.

Any ideas?

-----------------------------

Update: I forgot about post_max_size, so I went and changed that in all my php.ini files. I was set to 8M, so that should not have been a problem, but I upped it to 20M.

Also, it occurred to  me that lighttpd might not be reading it's config files with just a restart, so I did force-reload as well.

# /etc/init.d/lighttpd force-reload
[ ok ] Reloading web server configuration: lighttpd.
root@fir:/home/walter# /etc/init.d/lighttpd restart
[ ok ] Stopping web server: lighttpd.
[ ok ] Starting web server: lighttpd.

Logged out of moodle, logged back in, same thing. 

--------------------------------

Update 2:

I am using firefox. I cleared my cache. Closed all my tabs, and shutdown my browser.

I brought everything back up, but I am still having the exact same problem.



Average of ratings: -
In reply to Walter Byrd

Re: Changing upload_max_filesize in php.ini is not working

by Walter Byrd -
Update 3:

Forced php-fpm to reload it's config files:

# /etc/init.d/php7.3-fpm force-reload
[ ok ] Reloading PHP 7.3 FastCGI Process Manager: php-fpm7.3.

That changed my upload limit. But when I try to restore, I get a "Database Error."

---------------------------

Update 4:

Backed up my course, and restored from newly backed up file. It actually worked this time.

Whew.