1

I get this error:

"Maximum allowed file size for upload is 2m. Please check your server PHP settings"

Magento ver 1.9.1.0 VPS Linux server with WHM Manager and cPanel access.

Every time I try to upload a file larger then 2M inside Magento it gives me that error. I have added the line php_value upload_max_filesize 10M to both my .htaccess and php.ini files in the public_html folder.

I have gone into WHM and into the configuration editor and changed it to 10mb there. I hop into cPanel and in the PHP Configuration it says its set to 10m, but, when I go to sewchacha.com/phpinfo.php it says that the max upload size is set to 2M.

I have multiple other sites on this server in their own cPanel's and they show the correct 10m with the phpinfo.php file. It is only this site that doesn't show it correctly. Yes I have restarted the server several times after making the changes in the .ini and .htaccess files.

Is there something in Magento that is overriding the server settings?

Am I missing something?

Thank you for your help!

  • Is APC in play? – Melvyn Mar 14 '15 at 11:34
  • Have you put a phpinfo() file at the root and checked what the actual value is set to? Some hosts ignore php.ini and htaccess overrides. – Jongosi Mar 14 '15 at 13:04
  • Yes, I have the phpinfo.php file in the root right now, and it shows 2mb for the upload_max_filesize when the server shows it set to 10 in both the WHM and cPanel, and the .htaccess file and php.ini files both have it set to 10M in them. – Mike Mar 14 '15 at 18:32
  • @Melvyn what it the "APC"? – Mike Mar 14 '15 at 18:33
  • @Melvyn (I Figured out what APC was) I do not see APC enabled when I go to the phpinfo.php. I don't see it enabled on my other site either. My other site works fine and shows the correct upload size in its phpinfo.php file. – Mike Mar 14 '15 at 18:41
3

Disclaimer : On behalf of the OP, turns his comment into an answer

After spending hours on this I checked for the 20th time and the stupid php.ini file had upload_max_filesize 10M and not upload_max_filesize = 10M .

LOL that was the problem, it works now. Thank you for your help!

| improve this answer | |
1

See your PHP Info - create a file called e.g. info.php and add following PHP code to this file:

echo phpinfo();

Run this file on your server and you will see all PHP settings, see upload_max_filesize directive.php info

If there is only 2M (2 MB), you should increase your upload file size in your php.ini.

; Maximum allowed size for uploaded files
upload_max_filesize = 10M

Save your php.ini and restart your server.


Is it not your server? (Just to test)

Try to add the following code to your index.php file (or your main script file):

ini_set('upload_max_filesize', '10M');

Reference here.

| improve this answer | |
  • Adding that on my index.php is also not working. – Afreen Sheikh Feb 24 at 11:55
  • @AfreenSheikh add in your pub/index.php – Rafael Corrêa Gomes Feb 24 at 14:40
  • Adding it in my pub/index.php also didn't work. – Afreen Sheikh Feb 26 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.