I love WordPress, or how to modify the php.ini file for uploads over 2MB on Bluehost

I Love WordPressI’m finally back at the blog, and while I have been away for a while, I am happy to say that this was only because so many cool things have been happening. In fact, this post is just to frame a tiny (yet crucial) element of a larger push by the faculty I work with at UMW to re-imagine the relationship of the web to their research, teaching, and learning practices. While each of these projects have much in common, they are all particular enough that they will need a more sustained tracing of the development, planning and final product on this blog, something I plan to begin this weekend. However, if you are dying for the 30 second version -which I know you are- here it is: I have been collaborating with a number of professors over the past month (during the Summer mind you – these folks are dedicated!) to re-examine and re-imagine what they are doing with the all too traditional, locked-down, and patented Course Management System the University offers (namely BlackBoard) in an effort to redefine and their own relationship to other possibilities for using web-based technology to guide a class through a series of intellectual discoveries.

The reason why I am able to even consider such a thing at this moment is largely based upon the fact that WordPress 2.0.4 (with a K2 0.9 theme, mind you) has been made increasingly more user-friendly, effectively making the technology a tool rather than an impediment. Software like WordPress offers a golden opportunity to re-examine the static, imprisoned web-based teaching resource that is BlackBoard, simultaneously allowing for a driven exploration of the boundaries of the dynamic, web-based classroom premised upon an open-source model. “How so?” you ask. Well, quite frankly, because programs like WordPress are pretty damn easy to use! I can train a group of professors who are familiar with BlackBoard to use Wordpress effectively in about a half hour! In fact, while WordPress is recognized as a blogging software – a realm wherein it is unmatched – it is also an exceptionally intuitive and comprehensive Content Management System (CMS). And while the CMS wars rage on, to quote Darcy Norman, I am playing with Drupal for larger community sites but staying with WordPress for the one off class sites because the low threshold for competency and the strong possibility that faculty might immediately be able to adopt and manage a WordPress site is much more likely than a Drupal site – but I may be showing my prejudices here given my less frequent exposure to Drupal than WordPress. However, as I have become more and more familiar with programs like Lyceum and WordPress Multi-User the idea of scaling becomes less frightening for such a solution.

So why the crazy techy-specific title to this post then? Well, because one of the beautiful new elements of WordPress 2.0x is the ability for users to upload files quickly and easily. For example, a user can now upload an mp3 files that can then be integrated with the inimitable wordpress plugin PodPress, a process that would have required an ftp client previously. While I was giving a demonstration of Wordpress’s upload feature for podPress to a professor this morning, I failed to realize that Wordpress has the uploading limit set to no more than 2MBs (that is what an FTP client like transmit will do to the honest MAC user!). So while I was uploading a 3.5 MB mp3 file, I got a friendly reminder from WordPress that I needed to changed the maximum file size limit for upload in my php.ini file, so without further ado – this is how you do it if you are using Bluehost and WordPress 2.0x (I imagine any other web-hosting service will have a similar php.ini file they can send you so that you can still use the directions below.):

  • Get a copy of the standard php.ini file that is used with your web-hosting service. if you use blue host click php.ini for a copy.
  • Now, seach for the upload parameters in the php.ini document (they should be around line 251 in the ini file above) which will look something like this:
    ;;;;;;;;;;;;;;;;
    ; File Uploads ;
    ;;;;;;;;;;;;;;;;
    file_uploads = On; Whether to allow HTTP file uploads
    ;upload_tmp_dir = ; temporary directory for HTTP uploaded files (will use system default if not specified)
    upload_max_filesize = 2M ; Maximum allowed size for uploaded files (fyi, M = MB)
  • This is where you will change upload_max_filesize = 2MB to the appropriate size for your purposes – I went to 8 MB, for example (but go higher if you will be doing video!). Also, as Ricky Raw says in the comments below you may want to change post_max_size to the same value.
  • Once this is done you need to save the file as php.ini and place in the wp-admin (and try wp-includes if that doesn’t work) folder within the WordPress directory.
  • And D-I-S-C-O, DISCO!! Now all your faculty can leave behind the ossified world of traditional Course Management Systems and begin forging a new community within the excitingly intersections of teaching, learning and scholarship in an open and accessible web-based environment!

    I love WordPress!

Related posts

31 Responses to “I love WordPress, or how to modify the php.ini file for uploads over 2MB on Bluehost”


  1. 1 D'Arcy Norman Aug 17th, 2006 at 11:58 pm

    you should also keep in mind the maximum execution time setting. if it’s too low, the server may terminate an upload, even if it fits in under the filesize cap. probably not an issue, but if you get stuck uploading large files, that’s one thing to check.

  2. 2 jimgroom Aug 18th, 2006 at 9:03 am

    Thanks Darcy, I’ll make the change. Can I ask you – do you have some examples of Drupal sites you have worked on at Calgary? I am giving a small presentation on CMSs and instructional technology and I am sure your work would convert many a soul!

    Best

  3. 3 Gardner Aug 18th, 2006 at 9:59 am

    Deeply cool, both of youse. Thanks a bunch.

  4. 4 kevin r hollo Jun 20th, 2007 at 12:36 pm

    hello hello,

    i’m curious about this process, i went ahead and used the code you provided with the bluehost link, but i wasnt sure if the saved file would have to match the extension of all my other blog files (adobe live).

    does this work if you just edit the code in adove live? then save as ini.php? why is it reversed, as “php.ini?”

    best,
    kevin

  5. 5 jimgroom Jun 20th, 2007 at 2:28 pm

    Kevin,

    I’m not entirely sure I understand your question. But here’s what I think you may need to do. Don;t edit it in adobe live, just copy and paste the code into a plain old text editor and save it as php.ini (the ini needs to be at the end of the file -for it is an extension the web server will read to get the settings for all your PHP goings on in your public_html folder). For example, if you are using WordPress and want to increase the upload limit for your files, just save a copy of php.ini in the wp-admin folder and that should do it. Am I making any sense?

  6. 6 Daniel Jul 30th, 2008 at 8:56 pm

    That’s very helpful, thanks a lot! The comment at the end helped though, I though Wordpress looked for the php settings in the includes folder by default :) But I have realized the error of my ways and moved it to the relevant directory :)

  7. 7 Greg Aug 8th, 2008 at 3:21 am

    Very helpful article, but the “where to put the modified php.ini file” info is inaccurate, at least with WP 2.6.

    The article itself says to put the modified php.ini file in wp-includes, and the link via the 7/31 pingback recommends putting it in every directory that has PHP files, essentially. The former is wrong and the latter is “overcomplete.”

    I just did this and learned that the modified php.ini file has to be (and ONLY has to be) in wp-admin/, because that’s where the relevant script, i.e. “upload.php” lives. I assume it’s just been moved since this article was written back in 2006.

  8. 8 Reverend Aug 8th, 2008 at 4:30 pm

    Greg,

    Excellent info, I haven’t played with this for a while, but I will be testing it shortly, and your advice comes at just the right time. Thanks for clarifying here in the comments, I’m sure others will find it useful as well.

  9. 9 Batman Aug 12th, 2008 at 12:47 am

    Thanks for this! Yes it needs to be in admin folder to work, did not work when in includes. Thanks again!

  10. 10 sean Dec 18th, 2008 at 8:35 am

    thanks for this…but damned if I can find the php.ini file! I see that it should be in the includes file. if it’s not there, do I create one?

    thanks in advance…don’t want to take too much of your time.

  11. 11 Reverend Dec 18th, 2008 at 8:42 am

    Sean,

    Check the root of your wordpress install and then the wp-admin, if you don;t see one in either place create one and put it in the wp-admin folder, see if that works.

  12. 12 Nicky Mar 18th, 2009 at 11:36 am

    Thank-you-

    this was very helpful.

  13. 13 Reverend Mar 18th, 2009 at 1:57 pm

    Micky,

    No problem, and quite an attractive portfolio site I might add.

  14. 14 Tom Mar 31st, 2009 at 3:01 pm

    If you’re on Lunarpages (which sucks in certain ways- no wildcard dns) it seems you need to add one more step.

    Assuming your php.ini file is on in your public_html folder -

    Add this line to a .htaccess file: (replace “yourusername” with your cpanel user name – there is a space between path and /home)

    suPHP_ConfigPath /home/Yourusername/public_html

    Now your PHP upload limit should be increased.

    directions adapted from here.

  15. 15 T. AKA Ricky Raw Apr 23rd, 2009 at 2:11 am

    This is a very helpful guide, but you forgot to add one thing. It is not enough to change the upload_max_filesize value but also you must change the post_max_size value as well to the same value, otherwise the smaller sized value wins.

  16. 16 Scott May 9th, 2009 at 5:29 pm

    Hi,
    I just went through this exercise and realized that you need to put the php.ini file in the wp-admin folder, not the wp-includes folder. The original post says “wp-includes” and then in a later comment it says “wp-admin”. Well, wp-admin worked for me.
    -Scott

  17. 17 Reverend May 9th, 2009 at 11:53 pm

    Thanks Scott and Ricky Raw,

    I will change the post to reflect these instructions shortly.

  18. 18 LawOfAttraction Guy May 19th, 2009 at 3:33 pm

    Thanks so much.

    This solved my problem. You rock!

  19. 19 chris May 19th, 2009 at 3:39 pm

    My sited is hosted with bluehost, and I changed my PHP.ini file and it worked great. However the SWF Uploader in 2.7 is still not accepting large files.

    instead it says: This file is too big. Your php.ini upload_max_filesize is 20M.

    but the file is definitely less than 20M

    Has anyone else experienced this?

  20. 20 Jennifer Cannady Aug 17th, 2009 at 6:44 pm

    Oh my gosh. That worked like a charm. It’s importing all my stuff. THANK YOU SOOOO MUCH!

  21. 21 A Lui Sep 7th, 2009 at 1:50 pm

    Thanks for the post. The tutorial from my web host is wrong, and *you* solved my file size problem! :)

  22. 22 Helpful guy Sep 8th, 2009 at 6:49 pm

    I read a ton of blogs and called my hosting provider multiple times. I am using wordpress and ftp surfer. I used multiple sources and finally was able to solve my problem after nine hours. It was all because of a 5. For my php.ini file on who i host with godaddy I tried multiple things. First off, my php.ini file was right when I opened up my FTP Surfer. It had to be moved to wp-admin. Secondly, it has to be renamed to PHP5.ini. That was my downfall. I did not put a gosh forsaken 5. Finally I obtained a helpful link from Godaddy for coding. I placed it here for people who need help like me. http://help.godaddy.com/article/1475?. Finally, I placed the code in and it is as follows:

    register_globals = off
    allow_url_fopen = off

    expose_php = Off
    max_input_time = 600
    variables_order = “EGPCS”
    extension_dir = ./
    upload_tmp_dir = /tmp
    precision = 12
    memory_limit = 64M
    post_max_size = 64M
    file_uploads = On
    upload_max_filesize = 64M

    There were a couple of extra lines but just leave them in the file.
    At the end of this painful process over a 5 was able to place my video which was greater than 8 MB. Please see my end result at:

    http://www.mortgageforeclosurereport.com/ed-mcmahon-was-he-so-different/

    I hope this helps others in need and saves some time and effort.

  23. 23 Helpful guy Sep 8th, 2009 at 6:56 pm

    One more thing. Please note that if you are not using GoDaddy and Wordpress with the most recent hosting then you probably do not have to put a 5 after the php and you can use the coding the same exact way. From my understanding.

  24. 24 Reverend Sep 9th, 2009 at 10:10 am

    Thanks Helpful Guy, I haven;t tested your work through, but I’ll have to look into it.

  25. 25 Jeremy Reid Oct 27th, 2009 at 2:25 pm

    Attn: chris (and anyone else who has the same problem)

    If Wordpress is complaining that “Your php.ini upload_max_filesize is 20M” or more when your filesize is less than that, take a look and see what your “post_max_size” is set to in your php.ini

    It’s probably too low, so just set it to

    post_max_size = 20MB

  26. 26 Asheville Web Design Dec 9th, 2009 at 11:11 am

    Thanks man! That totally solved my problem. Just a little ini file can make or break your blog.

  27. 27 Erik Hansen Feb 15th, 2010 at 3:16 pm

    @Jeremy Reid – That worked for me, thanks!

  28. 28 Stuart L Feb 21st, 2010 at 4:16 pm

    All this being said, I had done a slightly different fix for upping the memory limit prior from info in a codex posting which worked fine until today’s upgrade to 2.9.2

    I went ahead and copied my php.ini file into the wp-admin folder (something I had never done before). So this worked good. Will it also survive future wp upgrades now?

    Thanks.
    Stuart.

  1. 1 Wordpress php.ini - where to place : Weblog Pingback on Jul 31st, 2008 at 1:49 am
  2. 2 I love WordPress or how to modify the php ini file for uploads | Outdoor Ceiling Fans Pingback on May 31st, 2009 at 5:27 am
  3. 3 I love WordPress or how to modify the php ini file for uploads | basketball hoop Pingback on Jun 18th, 2009 at 2:19 am

Leave a Reply




EDUPUNK: DIY EdTech

dev.WPMuEd Contributor

about

bavatuesdays.com is an ongoing conversation about media of all kinds ...

Testimonials:

Generations from now, they won't call it the Internet anymore. They'll just say, "I logged on to the Jim Groom this morning.
-Joe McMahon
Everything Jim Groom touches is gold. He's like King Midas, but with the Internet.
-Serena Epstein

My understanding is that an essential requirement of the internet is to do whatever Jim Groom asks of you while you're online.
-James D. Calder

I am Jim Groom

Find out more about me here.

browse the bavarchive