The MU forums have moved to WordPress.org

php.ini and .htacess for large file uploads? (23 posts)

  1. i8therice
    Member
    Posted 14 years ago #

    I am running a wordpress mu site that is going to require large video file uploads. 30+ MB per file. files smaller than 30 mb upload fine but when a file larger than 30mb is uploaded the upload hangs at a specific percentage of the file (for example if the file is 100MB the upload hangs at 30%) my php.ini and htaccess files need rewrites, help!!!!!!!

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Did you talk to your webhost?

  3. EternalSkyChaz
    Member
    Posted 14 years ago #

    I had the same problem last night, attempting to upload media to a test site that I want to show to a client. This really shouldn't be happening and you can't just blame the web hosting company. When I use an ftp program like Cyberduck to upload files, I can upload any size I want.

    And yes, I changed the media Max Upload size to be much larger than the file I was trying to upload and that did not change anything. In fact, the Flash uploader kept coming back and giving me this error:

    This file is too big. Your php.ini upload_max_filesize is 2M.

    Even though I changed the max media upload file size to 250 megs!

    And the Browser uploader just plain locks up without even uploading anything.

  4. SteveAtty
    Member
    Posted 14 years ago #

    Yes but did you change it in your php.ini file. WPMU can't upload anything bigger than the size set inside WPMU and if that exceeds the size set in php.ini then that will be your limit. So you need to increase the limit inside your php file and then restart your webserver.

  5. andrea_r
    Moderator
    Posted 14 years ago #

    .. and the file size limits set by the php.ini are indeed set by your webhost. Not MU.

  6. SteveAtty
    Member
    Posted 14 years ago #

    Also wont uploading something like 100MB exceed the max php script execution time? And just how long is it going to take to down load it? I hope you've got a seriously good deal on bandwidth

  7. EternalSkyChaz
    Member
    Posted 14 years ago #

    First let me address the issue of bandwidth ...

    I've never had a problem. My account has 1.5 TB of monthly transfer. I have plenty of transfer. And even when I had only 100 gigs of monthly transfer I had previously uploaded files of between 35 and 70 MB via ftp without a problem. Remember, these are media files we are talking about - video files. In terms of downloading, they download a small portion to a viewer and begin to play while the remainder continues to download.

    Here is a copy of my php.ini file:

    register_globals = off
    allow_url_fopen = off
    
    expose_php = Off
    max_input_time = 60
    variables_order = "EGPCS"
    extension_dir = ./
    upload_tmp_dir = /tmp
    precision = 12
    SMTP = relay-hosting.secureserver.net
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
    
    [Zend]
    zend_extension=/usr/local/zo/ZendExtensionManager.so
    zend_extension=/usr/local/zo/4_3/ZendOptimizer.so

    I don't see that variable to set anywhere. If I can just copy and paste it in, what units is the variable looking for. In other words, if I set

    upload_max_filesize=1000

    Will that set the upload_max_filesize to 1000 megs or 1000 bytes?

    Also, if this particular variable trumps what you set in WPMU, why bother allowing a user to change things in WPMU?

  8. EternalSkyChaz
    Member
    Posted 14 years ago #

    Bump. I am bumping this because I am still trying to address this issue.

    If I can ftp files to my website that are upwards of 70 megs with no php.ini warning, why can't I do that with WPMU?

  9. SteveAtty
    Member
    Posted 14 years ago #

    Because php.ini has nothing to do with FTP. PHP is all linked in with the web server application and has nothing to do other O/s functions such as ftp, sftp, ssh and so on.

    You will need to add (in the correct php.ini file - you may have more than one depending on your server config)

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 4M

    with 4M replaced with say 300M for 300 MByte

    and possibly change:

    max_execution_time = 30

    which is how long a script can run before timing out. Not sure if this will kick in with a big load.

    and

    post_max_size = 18M

    Again I'm not sure if this will be affected

  10. tim.moore
    Member
    Posted 14 years ago #

    If I can ftp files to my website that are upwards of 70 megs with no php.ini warning, why can't I do that with WPMU?

    Because when you use FTP, PHP is not involved. PHP is only used to generate web pages.

    If what you displayed above is your entire PHP.INI file, you are missing a lot. But to fix the subject at hand, add a line that reads:

    upload_max_filesize = 250M

    This will tell PHP that it is allowed to upload files up to 250MB in size.

    You'll probably also want to add:

    max_execution_time = 30

    This says that PHP can spend 30 seconds executing a script. You probably want to up this to 60 or 120 to allow PHP to handle large files.

    max_input_time = 60

    This says that PHP can spend 60 seconds parsing data from an uploaded file. Up this to 120 or 240 to allow PHP to parse large files.

  11. EternalSkyChaz
    Member
    Posted 14 years ago #

    Thanks, but my web host sent me some instructions on how to change that file. I set it to 300 megs and I am still getting a similar error, even though my file size is just about 10% of the max_upload size (35 megs.)

  12. tim.moore
    Member
    Posted 14 years ago #

    What's the error you're getting, specifically?

    Have you talked to your web host? It may be that they are limiting something on their end.

  13. EternalSkyChaz
    Member
    Posted 14 years ago #

    Well, yeah, I talked with them, that's how I got the instructions from them. ;~)

    Getting the same error as before, but with a bigger number.

    Previous error message from WPMU:

    This file is too big. Your php.ini upload_max_filesize is 2M.

    Current error from WPMU:

    This file is too big. Your php.ini upload_max_filesize is 300M.

  14. mindflow
    Member
    Posted 14 years ago #

    Hey guys, saw this today.

    Look in /wp-settings.php

    WP Ver: 2.8.5

    Find at very top of page:

    if ( !defined('WP_MEMORY_LIMIT') )
    	define('WP_MEMORY_LIMIT', '32M');

    Weird, I ask WP dev people, Why is this not in the Admin-Settings in dashboard???

    Hope it helps :)

  15. EternalSkyChaz
    Member
    Posted 14 years ago #

    Additionally, if all these other settings are so critical, then why:

    a) is there no way to adjust these settings in the Dashboard?
    b) why is there the requester in the Dashboard for max_upload when we have to set that manually?
    c) why doesn't WPMU simplify things for itself and its users by incorporating a true ftp module that allows users to store an retrieve files in custom locations? All you would need to do is pay a small license fee for really great ftp programs like Cyberduck or Fetch and rewrite the front end/CSS to incorporate it into WPMU.

    Stop trying to tell WPMU users what kind of files we can use, how to use them and where to keep them and all of us, users and WPMU coders alike will be much happier with this product.

  16. ronhosner
    Member
    Posted 14 years ago #

    Be carefull with changing upload_max_filesize, process can monopolizing all memory and server will crash.

  17. aschreck
    Member
    Posted 14 years ago #

    I'm not actually running an MU so, moderators, feel free to re-direct or move. (But I haven't been able to find another related topic anywhere on the web.)

    -------------
    I'm in the same situation, uploading large video files, and I have the same issue with the WP GUI. You can see the error code ("This file is too big. The maximum upload size for your server is 4M.") here:
    http://cuppaschmutz.com/wp-content/uploads/2010/01/WP_GUIfilelimit.jpg

    I've also bumped up the file size limit on both the php.ini and php-settings.php without any luck.

    However, I'm able to upload large files to any directory I'd like using FTP.

    Interestingly, I'm getting *the same* error on a different site entirely. In fact, different site, different hosting company and servers (FatCow for one, BlueHost for another).

    I'm using the following theme from Jason Schuller on both sites (and I'll email him/his company tomorrow to see if they have any insight, in a brief earlier communication he responded very quickly) tomorrow to see if he has any insights. I wonder if i8therice is using a theme from press75 too...
    http://www.press75.com/v4/the-on-demand-wordpress-theme/

    I'm using WP 2.9.1 *with* the following plugins:

    --------------------------
    akismet
    bubblecast-video-plugin
    on-demand
    post-plugin-library
    requirements-check
    reveals-ids-for-wp-admin-25
    similar-posts
    simple-post-thumbnails
    simple-video-embedder
    stream-video-player
    twitter-tools
    vipers-video-quicktags
    wordtube
    wp-pagenavi

  18. SteveAtty
    Member
    Posted 14 years ago #

    Can you create a info.php file in the top level directory and put this in it:

    <?php
    
    phpinfo();
    
    ?>

    And then access that from a browser and it should show you al your PHP configuration. If that still shows the 4MB limit then its not WP or WPMU.

  19. chrism018
    Member
    Posted 14 years ago #

    Our site is hosted by Register.com. They keep the php.ini file private and state that it cannot be bumped as it affects all register hosted sites. We tried creating a phpinfo.php file and placing that in our root directory but could no access that from a browser. we also tried creating a info.php file and tried that in our root and couldn't access information from our browser.

    They tried several work arounds (many that I found on forums as well) such as creating a php.ini file with the file size we need (also adjusted post size and time size as well) and to place that in all folders relavent to our uploads (public_html, wp-includes, wp-content,wp-content/uploads, etc.), all had no affect as when trying to upload (from within WP) a video larger than 12 MB, we get the error message others have shown (exceeds ... 12 MB).

    We tried creating/and or modifying the .htacess file in the root to include the new file size, post size and time limits, all to no avail. We tried modifying the wp-config file to add the new increase file limit with no positive result. We tried creating a plugin from http://simplercomputing.net/2009/02/13/fix-php-max-upload-size-wordpress/ and installed it and activated it but with no positive result. What are we missing? we have tried using the php.ini file in combination with adding the .htacess file and had no positive result. Any additional things we can try?

    We were on with Register.com for 4 hours and decided to keep trying on our own as they stated they have done all they can do.

  20. andrea_r
    Moderator
    Posted 14 years ago #

    It's the server. Really.

    unless you want to just ftp the files and reference them in your posts, you are stuck. WP just follows what the server is set at.

  21. chrism018
    Member
    Posted 14 years ago #

    To follow up, I was able to solve the problem I reported yesterday by placing a php.ini file in three areas:

    1. public_html
    2. public_html/wp-admin
    3. in the destination folder where the larger video file was to be stored (public_html/wp-content/upload[and for me there are folders showing years such as 2010/01 - your path will differ inside of the Uploads folder]).

    Then WP allowed me to upload a 78MB file from the media loader, when previously, I was restricted to files up to 12MB.

    I spoke with 6 different techs at Register.com and the last one: Shane G. was the gem. This matter is closed. The php.ini file I created is as follows:

    [PHP]
    memory_limit = 100M
    upload_max_filesize = 192M
    post_max_size = 100M
    file_uploads = On

    Of course I can change these fields to suit my needs. This method definitely works to override the hosting limitations set in their php.ini file.

    I hope this helps someone!

  22. chrism018
    Member
    Posted 14 years ago #

    I forgot to mention, be sure to change your PHP Configuration setting in your cPanel to PHP 5. Register.com defaults to System Default.

  23. journey5956
    Member
    Posted 14 years ago #

    FYI - I had several issues and hope this info will help.

    PHP Version and Test
    Not sure about other hosts, but 1 and 1 Hosting leads you to believe you are using PHP 5, but very likely it's a version of PHP 4. This creates all kinds of issues. To test, create a new file in Notepad, paste this simple line of code, "<?php phpinfo(); ?>" (without the quotes) and save as "test.php" (without the quotes). Upload to your root directory - then type the following into your browser, "www.yourdomain.com/test.php" and you will find what version you are actually using. Replace "yourdomain" with your own domain name.

    Correct PHP Version Issues with .htaccess file
    Create a new file in Notepad if you do not have an .htaccess file already. Place this line of code in it, "AddType x-mapp-php5 .php" (without the quotes) and save the file as .htaccess - be sure there is no .txt - ONLY ".htaccess". Upload the file to your root directory. Basically, this just tells your files to use PHP 5.

    Automatic Updates & Plugin Issues – Memory Issues – PHP.ini file
    If you try to update WP automatically or install/activate plugins and all you see is "unzipping", "unpacking" or something similar - essentially nothing really happens, it is very likely you do not have enough memory allotment to execute.

    You may also experience “500 Internal Server Error….” when working with plugins – or nothing appears after you activate a plugin on page/post editors, etc.

    If you have or can access your php.ini file, check to see the “memory_limit” or “upload_max_filesize” – if you don’t have a “php.ini” file, create one in Notepad and insert the following:
    memory_limit = 100M
    upload_max_filesize = 192M
    post_max_size = 100M
    file_uploads = On

    Save/upload to your root directory. I also included it in my wp-admin folder just in case.

    Plugins and “500 Internal Server Error”
    If you are stuck with a “500 Internal Server Error” on your screen when dealing with plugins – try going back on your browser and check the “deactivate all” box and apply. If you can’t get back, go to your “Plugins” folder and just rename it briefly – i.e. “plugins5” – that will automatically deactivate all your plugins – go back to your admin area and check installed plugins – you should be able to access everything again. You can now try activating one plugin at a time to see if there’s a conflict, OR it may just be a memory issue – see above.

    FYI – I am not a programmer – I spent 3 days uploading, installing/reinstalling WordPress and activating/deactivating plugins, ftp uploads, etc on 3 blogs and searching Google and any other source I could find until I discovered this info.

    Please feel free to correct anything you feel is incorrect – this is just what worked for me. Hope this helps someone else’s frustration.

About this Topic

  • Started 14 years ago by i8therice
  • Latest reply from journey5956