Simple Solution for WordPress Error: “Your php.ini upload_max_filesize is 2m”

By Michael in WordPress with 12 Comments

Recently, a client emailed me and stated he was having trouble uploading an image with the WordPress Image Uploader. Each time he tried to upload the image, WordPress gave him this error message:

“Your php.ini upload_max_filesize is 2m”

After doing a bit of research I discovered what was causing the problem. Without getting too technical, the PHP settings of his web server were limiting the maximum file size that he could upload.

The fix is rather simple:

1. Open your favorite text editor, such as Notepad, and paste in this code:

[PHP]
; Increase maximum post size
post_max_size = 20M

; Increase maximum upload size
upload_max_filesize = 20M

1a. You may want to increase or decrease the “20M” above (20M = 20mb).

2. Save the file as php.ini.

3. Next, upload the php.ini file to to the WP-Admin directory in your WordPress installation. the directory in which your core WordPress files are stored.

4. After that’s done, you may need to dump the cache on your browser and restart your browser.

5. If you still have problems after all that, try uploading the file to the main directory of your WordPress installation. And if you still have problems after that, you should contact tech support for your web host. Tell them you are trying to increase your maximum file upload size, and ask where you should place your php.ini file.

  • Share/Bookmark

Take Your First Step Toward Living a Bigger Life

Subscribe to Live a Bigger Life and get inspiring ideas and strategies that will help you use the web to make a difference in the world, make more money and live a bigger life. Just enter your name and email address below, and click submit.

Comments (12)

Trackback URL | Comments RSS Feed

  1. JamesD says:

    Thanks for the useful info. It’s so interesting

  2. Dan says:

    Thanks Michael, I ended up with the php.ini file in wp-admin, worked a treat.

  3. Bob Bean says:

    Thank you thats amazing!

    I have been searching for a solution to this for days and you made it so simple.

    THANK YOU!!

  4. Bradley says:

    Thanks. Funny how something so simple turns out to be an FTP upload and an edit (or creation) of a php.ini file. I suppose this isn’t a WP option, but a hosting limit? Anyway, thanks again for the simple explanation.

  5. I also ended up with the php.ini in the wp-admin directory and worked fine. Thanks a lot this was very helpful.

  6. Alan says:

    Right on works like a charm! Quick & Z-Z

  7. Jessica says:

    I’m so happy; it worked for me too.

    Thank you….

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.