WordPress.org

Ready to get started?Download WordPress

Forums

HOW TO: Increase file size for Media Upload (9 posts)

  1. petedutcher
    Member
    Posted 5 years ago #

    I ran into this issue with WordPress...a client made a video and wanted to upload it to her website...but when she tried using the Media uploader, it said the upload limit was set to 8mb!

    Now, after a search (multiple ones, different terms, I realized this is a common problem. I use GoDaddy servers, btw.

    The problem in fixing the issue is this: out of all the suggestions I found on my searches, including these forums, nothing worked.

    I had access to the php.ini file and inserted the following into it:

    memory_limit = 100M
    upload_max_filesize = 192M
    post_max_size = 100M
    file_uploads = On

    php.ini was in my root folder, and WordPress was installed into a subdirectory. (/site). Changing the root folder php.ini file did not fix the issue. I then copied that same file to the WordPress root directory. Still no go.

    Then I copied it to the wp-admin folder (trying anything at this point). I had read (somewhere) that this had fixed the problem for someone. It still did not work.

    As I was sitting there, getting frustrated (btw, IF WordPress would just have an option setting to do this that creates the proper file, it would be awesome), I was also getting desparate. The client needed the file uploaded within a few hours.

    And then it occured to me.

    GoDaddy had switched to PHP 5 already. So I went into the /wp-admin folder, and renamed the php.ini file I'd copied there to php5.ini.

    It worked!

    So here are the proper steps:
    1) Use FTP to download a copy of your php.ini file
    2) modify that file to have the following lines:
    memory_limit = 100M
    upload_max_filesize = 192M
    post_max_size = 100M
    file_uploads = On
    3) save, close and rename that file to "php5.ini" and upload it to the wp-admin folder of your wordpress install

    Note:
    I did not remove the

    memory_limit = 100M
    upload_max_filesize = 192M
    post_max_size = 100M
    file_uploads = On

    From any of the php.ini files I'd created along the way...didn't think it actually mattered.

    If you follow these steps, you can customize the file size limit for WordPress. I set mine to 100mb, but you can pretty much choose the size, according to your webspace available (I have 150 GB myself). To test it, I successfully uploaded a 37 mb Photoshop file.

  2. petedutcher
    Member
    Posted 5 years ago #

    Forgot to add, whenever I tried modifying the .htaccess file as suggested on several websites, the site went down and I had to change it back. Turns out you don't have to do so.

    And if you do not have a php.ini or php5.ini file in your root, you can create on with notepad.

  3. webjunk
    Member
    Posted 5 years ago #

    That is great that worked for you. But it will not work for everyone. Most servers you must put the PHP.INI (not always php5.ini) in
    1) the user's home directory
    2) the directory where the php script is run from
    3) the URL root (httpdocs or public_htmL).
    4) (Dedicated servers) Set when compiling PHP or installing the package but usually /etc You can locate it from a shell prompt:
    php -i | grep php.ini
    5) Windows Servers are usually C:\program Files\php
    Some hosting companies lock out any changes and all php.ini's will be ignored. Always best to ask your hosting company before causing problems. Or run a phpinfo() in a script and you will see the variable for where it needs to be. Some hosting companies especially on their lower end accounts have PHP Ez-config from within plesk or cPanel which makes it even easier.

  4. petedutcher
    Member
    Posted 5 years ago #

    Good point.

    I should mention this was on a GoDaddy, Linux Shared Hosting account.

  5. bigmacman99
    Member
    Posted 4 years ago #

    OK - this finally got me past the hump of being stuck with an 8MB file upload size when attemting to restore a backup of a blog. Now the problem for me is that it seems to be doing something for a while but then, after several minutes, produces a "The Page Cannot Be Displayed" error and a small pop up that says "there was an error processing your request".

    I can upload a smaller file just fine (I truncated the .xml file to see what would happen).

    Any suggestions?

  6. Shane G
    Member
    Posted 4 years ago #

    Hi,

    Save this code in any php file and update it in the plugins directory and activate that plugin:

    ini_set('upload_max_size','256M');
    ini_set('post_max_size','256M');
    ini_set('max_Execution_time','600');

    Set the settings to your desired one..

    Thanks,

    Shane G.

  7. johnzena
    Member
    Posted 4 years ago #

    I uploaded it as a php file into the plugins directory and it does not show up under plugins. Plus where the heck is the php.ini file, I don't see it on any of my websites. I have a dedicated server through midphase.

  8. cocscrap
    Member
    Posted 4 years ago #

    THANKS!!!!!!!!!!!! Petedutcher!!!! You're the best!

  9. surfeuse
    Member
    Posted 4 years ago #

    Shane G, I've tried your method but doesn't seem to work even after activating the plug-in. Any tips?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic