Forums

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

  1. i8therice
    Member
    Posted 1 month 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
    Member
    Posted 1 month ago #

    Did you talk to your webhost?

  3. EternalSkyChaz
    Member
    Posted 1 month 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 1 month 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
    Member
    Posted 1 month ago #

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

  6. SteveAtty
    Member
    Posted 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 week 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 :)

Reply

You must log in to post.

About this Topic