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!

This entry was posted in Uncategorized. Bookmark the permalink.

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

  1. 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. jimgroom says:

    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. Gardner says:

    Deeply cool, both of youse. Thanks a bunch.

  4. 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. jimgroom says:

    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. Daniel says:

    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. Pingback: Wordpress php.ini - where to place : Weblog

  8. Greg says:

    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.

  9. Reverend says:

    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.

  10. Batman says:

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

  11. sean says:

    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.

  12. Reverend says:

    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.

  13. Nicky says:

    Thank-you-

    this was very helpful.

  14. Reverend says:

    Micky,

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

  15. Tom says:

    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.

  16. 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.

  17. Scott says:

    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

  18. Reverend says:

    Thanks Scott and Ricky Raw,

    I will change the post to reflect these instructions shortly.

  19. Thanks so much.

    This solved my problem. You rock!

  20. chris says:

    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?

  21. Pingback: I love WordPress or how to modify the php ini file for uploads | Outdoor Ceiling Fans

  22. Pingback: I love WordPress or how to modify the php ini file for uploads | basketball hoop

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

  24. A Lui says:

    Thanks for the post. The tutorial from my web host is wrong, and *you* solved my file size problem! šŸ™‚

  25. Helpful guy says:

    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.

  26. Helpful guy says:

    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.

  27. Reverend says:

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

  28. Jeremy Reid says:

    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

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

  30. Erik Hansen says:

    @Jeremy Reid – That worked for me, thanks!

  31. Stuart L says:

    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.

  32. Thank you very much for taking the time to publish this tip. You totally saved my life tonight if saving my life means giving me the ability to add an mp3 of Gary Numan’s “Cars” to a website I’m making about cars šŸ˜‰

    Thanks again!

  33. Pete K says:

    After 6 hours of putting php.ini in every directory imaginary (no clue where it was supposed to go) you saved my sanity and scalp.

    No other site I visited – and I visited a lot – said ‘put the damn thing in wp-admin’.

    Again huge thanks!

  34. Pingback: I love WordPress, or how to modify the php.ini file for uploads over 2MB on Bluehost | bavatuesdays « Gregory Reese Research

  35. Momar says:

    Thanks! Dropped it right in the “WP-Admin” folder, and all was gravy!

  36. Anime says:

    How do I edit the php.ini file when I don’t have sufficient privileges? I have admin permissions/root permissions, but it says the password is wrong, so I’m trying to figure out how to do it without the admin password. Or if you could tell me how to transfer root accounts that’d be great.

    Regards,

  37. allampatu says:

    damn, so easy!

  38. Amir says:

    I use to upload large pdf and word files and this was exactly what I needed. I still use filezilla for large file like videos.

    Thanks!

Leave a Reply to Nicky Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.