I'm getting the above error in my development environment when i try to upload an image. I have followed other answers here by doing the following
but i still can't get past the error. Am I doing anything wrong? Below is the relevant section from my php.ini file
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 100M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 125M
If you're using LAMP (Apache server), you need to edit both /etc/php/7.2/cli/php.ini
and /etc/php/7.2/apache2/php.ini
.
Properties to edit to the desired values (ex. 10 Megabytes):
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 10M
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 10M
After saving the php.ini
files, run:
sudo service apache2 restart
Note: before editing the php.ini
values, ensure that /etc/php/7.2/apache2/php.ini
is the loaded php configuration file. The command is: php -i | grep php.ini
I agree with you. I am developing a project with Laravel, and the PHP version I use is 7.2, but the upload_max_filesize = 100M
line that I was changing when I made changes from the WAMP server was the php.ini file for PHP 5.
I created a blank page in my project and found where the php.ini file was with the phpinfo()
command.
File path in me: C:\wamp64\bin\php\php7.2.4\php.ini
And I was shocked when I saw that the line upload_max_filesize
was 2M. When I made the change, I restarted the services and I am happy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With