Viewing 9 replies - 1 through 9 (of 9 total)
  • wpismypuppet

    (@wordpressismypuppet)

    It’s a restriction in PHP, not WordPress. The best solution is if you have access to php.ini, make the following changes:

    memory_limit = 32M
    upload_max_filesize = 10M
    post_max_size = 20M

    This, of course, depends on your hosting company. Most don’t allow direct access to php.ini, but offer alternative solutions to change just those values you need to alter. You’d have to check out your hosting company’s policy.

    You can also try to add this info into the .htaccess file by adding:

    php_value upload_max_filesize 10M
    php_value post_max_size 20M
    php_value memory_limit 32M

    But most hosting companies will restrict users from using .htaccess to modify php.ini information. Check with your host on the best solution, but these are the only two options.

    Thread Starter chaplaindoug

    (@chaplaindoug)

    My hosting compnay is me. I have full access to everything on the site and the server. There was not a php.ini or a .htaccess file in my web site’s root directory. So I added them (using Notepad) with the lines (and only the lines) given above. It still has not changed from 2MB limit. I logged out and back in and even restarted the web site, but the limit remains. Are there other lines that need to go before and/or after the lines given above?

    wpismypuppet

    (@wordpressismypuppet)

    php.ini will not be found in your website’s folder. If you have full access to your server, do a search for php.ini. It’s usually in an etc folder inside the php installation folder. How are you running your site? IIS, Apache??? Once you change the php.ini, you have to restart the web service.

    In order for a .htaccess file to modify the php.ini settings, you have to tell your server to let that happen… it’s not set to do so by default as it is a major security issue.

    And in order for a php.ini file within your website folder to modify the main php.ini information, you also have to have the server allow those changes.

    But none of that is necessary if you have full access. Just do a search for php.ini and find the lines above and change them. Then restart Apache or whatever you are using as a web service.

    Thread Starter chaplaindoug

    (@chaplaindoug)

    I am using IIS 7.0 (Windows Server 2008 R2). I will do as you say and report. Thanks.

    Thread Starter chaplaindoug

    (@chaplaindoug)

    Well I searched the entire server and the only php.ini found was the one I just created in the root directory of the web site. Any other ideas?

    wpismypuppet

    (@wordpressismypuppet)

    Open up your index.php file on the root of your website and add the following as the FIRST line:

    <?php phpinfo(); die(); ?>

    Now load your website and you should see a whole PHP Version informational page…

    Look for a line “Configuration File (php.ini) Path” and see what path is… That should show you where the file is located and you should be able to get it that way.

    I see you have asked about this at https://forums.iis.net/1102.aspx

    You should be able to get help there. This is not a WordPress problem but a server issue.

    https://sniptools.com/vault/windows-apache-and-htaccess-authentication may help but there is a lot out there.

    Thread Starter chaplaindoug

    (@chaplaindoug)

    I found out how to configure PHP (how to edit the php.ini file) on my server. In IIS I selected my web site, then under the IIS tools menu I selected the PHP Manager. Under the PHP Manager there is a hyperlink to the php.ini file (C:\Program Files\PHP\v5.3\php.ini). The link opens the php.ini file in Notepad. I found each of the lines mentioned and set them as follows:

    memory_limit = 128M
    upload_max_filesize = 10M
    post_max_size = 20M

    I saved the php.ini file, restarted the web site (from IIS). and now thenew limits are in place. Thank you.

    wpismypuppet

    (@wordpressismypuppet)

    No problem… Glad it worked out.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to Increase Upload File Size Limit’ is closed to new replies.