Why file upload show upload_max_filesize error even changes in php.ini or .htaccess file

Hi friends,

I am sharing my own experience, I have tried file upload in core PHP project its not work more than 2MB. I have tried searching for solutions…

After search i added file php.ini with code like below


But it’s not working, for checking i added one more file for phpinfo() to check upload max filesize changed or not. phpinfo() that show me upload_max_filesize=100M, yet there is getting restriction for file upload, then i tried for better solutions…

then i added code in .htaccess file like below

php_value memory_limit 120M
php_value post_max_size 100M
php_value upload_max_filesize 100M
php_value max_execution_time 500
php_value max_input_time 500

after changed .htaccess file i got same file size error…

My search faith was almost finished, I know after lots of search and try, i could not get solution for upload file more than 2MB…

After some time i was thinking phpinfo() that show me 100MB why its not upload more than 2MB file size, so i checked phpinfo() output in inner folder where i had written upload file code. i was surprised to see phpinfo() was showing upload_max_filesize=2M, I don’t know why its showing upload_max_filesize=2M in my inner folder, so i copied php.ini file and pasted to inner folder. after that i checked file upload and its working for me.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s