2020-03-13 14:06:22

Hi guys.
I have another problem. When ever I try to upload something it gives me this error

The uploaded file exceeds the upload_max_filesize directive in php.ini.

I tried adding a php.ini file in my document root with the following values:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300


How do I fix this?

If you found this post helpful, amusing or funny, please thumb it up!
To get in touch, please email me using the email link below this post. If you prefer, you can also send me a friend request on discord. I'm thetechguy#6969. Please do not send me a PM on here as I don't check those often.

2020-03-13 18:14:13 (edited by Ethin 2020-03-13 18:14:35)

@26, don't do that in your web root, do it in your global php.ini file. This is one of those pitfalls of PHP. Where that file is is heavily dependent on your distribution. Try this command as root to find it:

find / -name "php.ini" -type f
"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-03-14 04:54:01 (edited by gerech 2020-03-14 04:54:35)

@27, it gives me two files. the terminal output is below.

terminal wrote:

/etc/php/7.2/apache2/php.ini                                                   
/etc/php/7.2/cli/php.ini

which one do I edit?

If you found this post helpful, amusing or funny, please thumb it up!
To get in touch, please email me using the email link below this post. If you prefer, you can also send me a friend request on discord. I'm thetechguy#6969. Please do not send me a PM on here as I don't check those often.

2020-03-14 08:13:16 (edited by Ethin 2020-03-14 08:13:33)

/etc/php/7.2/apache2/php.ini

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-03-14 08:51:38

@29, it still gives the same error. I put the values like this

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

. I put them in both /etc/php/7.2/apache2/php.ini and /etc/php/7.2/cli/php.ini. What am I doing wrong here?

If you found this post helpful, amusing or funny, please thumb it up!
To get in touch, please email me using the email link below this post. If you prefer, you can also send me a friend request on discord. I'm thetechguy#6969. Please do not send me a PM on here as I don't check those often.

2020-03-17 19:36:34

Hello there. You need only change the /etc/php/7.2/apache2/php.ini file. You should not have to do anything with cli dir at all. After changing php values like that, you'll need to restart your apache2 server. sudo service apache2 restart or sudo systemctl apache2 restart. I honestly think I may have that systemctl command wrong as my system uses service to control everything with systemd. Only reason why I put that second command is didn't know what system you have. Maybe you've stated that but didn't read correctly. Anyways, HTH.

Jonathan Candler, A.K.A, Jonnyboy

2020-03-17 19:53:10

Systemd is systemctl restart apache2 or systemctl restart httpd, depending on your distro

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-03-20 11:27:52

@31. @32, it works. restarting apache did it.

If you found this post helpful, amusing or funny, please thumb it up!
To get in touch, please email me using the email link below this post. If you prefer, you can also send me a friend request on discord. I'm thetechguy#6969. Please do not send me a PM on here as I don't check those often.