Support » Fixing WordPress » Increasing upload max file size in php.ini

  • Resolved dearteco


    Hi there,

    Have been trying to upload images, and am receiving this error msg:

    “The uploaded file exceeds the upload_max_filesize directive in php.ini”

    How do I go about re-setting this? Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • let me guess they are over 2mb?

    You guessed right! I accidentally set my digi cam resolution to “high”.

    try putting something like this in your htaccess file
    php_value upload_max_filesize 10M // max size in Mb

    You will need to edit the php.ini file and restart the web server after you’ve made the change. Whether you can do this or not, depends on whether you have write permission to edit the file. In a Linux environment, the file is typically here:


    However, you will probably need “root” access in order to edit the file and reboot apache (I’m assuming that’s what you’re using).

    If your application is hosted, discuss it with your host webmaster. If you’re sharing the host with others, keep in mind that they probably won’t want to make the change just for you.

    Hi, I am not a programmer and know embarrassingly little about how to do so. Here’s what I came up with:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php

    # END WordPress

    Where would I put the above code?


    under </IfModule>

    Guessing will have to contact my host. Thanks for your help!

    you can try putting it under # END WordPress but not sure if it will make a dif.

    Having the same “The uploaded file exceeds the upload_max_filesize directive in php.ini”-problem and from what I read here, it seems that I have to contact my webhost, as I can’t see a php.ini anywhere on my server.

    But the strange thing is, before I upgraded to WordPress 2.0, I had no problem uploading bigger files – and therefore it seems not so logical to me, that I now would need to change a file I never had access to previously…

    Any ideas?

    I’m having the same problem and am trying to fix it with an .htaccess file. pizdin_dim said that the php.ini file would have to be updated, thoiugh. can I take it to mean that cahnging the .htaccess won’t work?

    Any issues with simply FTPing the file into the target directory and adding its info to the DB somehow?

    Here’s 2 ways to fix this problem:

    #1 Change your php.ini file if you have access to it. If your running a testing server on your own computer you can access it. If your hosting your site with someone like dreamhost you will not have access to it unless your using a dedicated server. Most are shared servers.

    To access the php.ini file while using your server on your computer or dedicated server you first need to find which .ini your database is using, so create a .php file and write this in between the <body> tags:


    Save the file and make sure your server is running. Open the file you just saved in your browser. Now look for: “Configuration File (php.ini) Path”
    Get that location cause that’s the active php.ini file.

    Goto that location and open that file. Note: .ini file are hidden files so you will need an editor that allows you to see hidden files… Dreamweaver and BBEdit are 2 examples.

    Change these lines to the app. config you like:
    These are my settings…

    memory_limit 20MB
    post_max_size 20MB
    upload_max_filesize 20MB
    max_execution_time 600

    Save the php.ini file and upload it back to the same directory. Restart your server and that’s it.

    #2 This is the easier way to fix the problem. All you have to do is overwrite those configurations by adding the following into your .htaccess file. The #Change upload limits is just a comment. You can put these lines before or after any other script in you .htaccess file. Save it and upload. That’s it! Hope this helps!

    #Change upload limits

    php_value memory_limit 34M
    php_value post_max_size 33M
    php_value upload_max_filesize 32M
    php_value max_execution_time 600

    #Change upload limits end

    Forgot to mention that after your done you must delete the .php file that you used to get the database info with. This is only if your using your public server.


    There can be security issues obviously.

    Pasting the following into my .htaccess file worked for me 🙂

    #Change upload limits

    php_value memory_limit 34M
    php_value post_max_size 33M
    php_value upload_max_filesize 32M
    php_value max_execution_time 600

    #Change upload limits end



Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Increasing upload max file size in php.ini’ is closed to new replies.