Engineer By Design

October4th

5 Comments

My website is hosted under Bluehost, which so far has been treating me well. I do a lot of uploading since my site also serves as my portfolio for art and music, and there have been times when I would attempt to upload something into Wordpress and it would give me the following error:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

I was able to fix the problem, so I figured I’d create a post to help out anyone out there who has this problem as well. This guide assumes:

This guide is current as of 10/4/2009.



1. Log into your Bluehost account and go to your PHP Config

01



2. Change PHP settings to PHP5 (Single php.ini)

The default settings on Bluehost sets your PHP is at PHP5. Change this to PHP5 (Single php.ini) and save changes.

02



3. Install the php.ini master file

Select Install the php.ini master file.

03

Once done installing, it should display a message that it was successfully installed. Note that when this creates the php.ini master file, it names it as php.ini.default.

04



4. Go back to your cPanel tab and open up the File Manager

05



5. Rename php.ini.default to php.ini

Locate php.ini.default (it should be in your public_html directory). Right click it and rename this to php.ini.

06

07



6. Edit php.ini

Once the file is renamed, right click php.ini and this time go to Edit. (I chose Edit over Code Edit because Code Edit opens it through something called “cPanel X” which I think is a bit more troublesome to use over just opening php.ini as a text file through Edit.)

Find upload_max_filesize through a CTRL+F search and you’ll find the little troublemaker. By default, it’s set to 2M, which is 2 megabytes.

08a

Comment out, versus deleting, upload_max_filesize = 2M by adding a semicolon to the beginning of the line. (It’s just good coding practice.) Then add a second line where you set your desired upload limit. I arbitrarily set mine to 20 megabytes.

09

Remember to save your changes, and that should be it!

5 Comments

  • Comment by ben — October 26, 2009 @ 7:20 pm

    Yes, this worked! Thanks! :)

  • Comment by Charlene — November 9, 2009 @ 11:52 pm

    You’re very welcome!

  • Comment by Charlie — January 19, 2010 @ 8:13 pm

    No this hasn’t worked for us. We have a podcast that has files around 70MB and we have set our filesize to 99M, 200M, and 2G but nothing has worked so far. Is there anything we can do or do you know what is wrong by chance?

  • Comment by Marie — February 3, 2010 @ 11:10 pm

    Thank you! I was looking all over the web for these exact instructions. Everyone else neglected to reference to “adding a default php.ini”. Whenever I manually added my own php.ini nothing happened :(. After an hour of wresting with this issue, your tutorial fixed it!

  • Comment by Frank N. Raymond — February 27, 2010 @ 9:30 pm

    You are the bomb!!! Thanks!! God Bless You!

RSS feed for comments on this post. TrackBack URL

Leave a comment

RSS