I'm working on multiple file upload while that time I've got an error
The file
"theOne.mp3"
exceeds yourupload_max_filesize ini
directive(limit is 2048 KiB)
.
So after that I've increased the post_max_size = 20M
and upload_max_filesize = 20M
and checked it within test.php
file it shows
Even though it shows 2M
within my Laravel Project and throws the error. What could be the reason behind this.
So finally I've solved it by myself might be I got downvoted for this but I don't know this worked for me even after apache2
restart that won't effect within my project but after that I've restarted my entire system
and it all works fine for me. The reason might be because of the cache memory but I'm not sure about that
Try this it may work ...
Create a file named php5.ini and copy and paste the below code into it. Then save it. Then upload it. php_value won't work in an ini file. It probably doesn't work because you left php_value before each line.
file_uploads = On
upload_max_filesize = 20M
post_max_size = 20M
upload_tmp_dir = /tmp/
Then save the file as php5.ini and upload it to the root of your site.
As you told you have changed the upload_max_filesize
and post_max_size
in your php.ini
What are the suspected issues
Make sure change in the correct php.ini
file if you have multiple installation of apache
Make sure that you have restarted your apache server
Note :
If you have written laravel rules change it accordingly like this, but it should not be the major issue
public static $updaterules = array(
'uploadedimage' => 'image|max:5000'
);
In my case I was running php artisan server in order to run laravel the server. So the changes applied for apache were not applied to php cli .
Apache
PHP CLI
What I recommend to everyone that faces this problem is:
Hope this helps
Restart PHP artisan serve (if you are using it).
I did all of the recommendations to no avail only to realise that I never restarted my PHP artisan serve.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.