WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Increasing upload max file size in php.ini (15 posts)

  1. dearteco
    Member
    Posted 8 years ago #

    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!

  2. hbalagh
    Member
    Posted 8 years ago #

    let me guess they are over 2mb?

  3. dearteco
    Member
    Posted 8 years ago #

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

  4. hbalagh
    Member
    Posted 8 years ago #

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

  5. pizdin_dim
    Member
    Posted 8 years ago #

    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:

    /etc/httpd/php.ini

    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.

  6. dearteco
    Member
    Posted 8 years ago #

    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
    </IfModule>

    # END WordPress

    Where would I put the above code?

    Thx!

  7. hbalagh
    Member
    Posted 8 years ago #

    under </IfModule>

  8. dearteco
    Member
    Posted 8 years ago #

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

  9. hbalagh
    Member
    Posted 8 years ago #

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

  10. maximilian
    Member
    Posted 8 years ago #

    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?

  11. bimo
    Member
    Posted 8 years ago #

    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?

  12. IIIIIIIV
    Member
    Posted 8 years ago #

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

  13. darrenterhune
    Member
    Posted 7 years ago #

    Here's 2 ways to fix this problem:
    *MAKE SURE YOU BACK UP FIRST JUST IN CASE !!!

    #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:

    <?php
    phpinfo();
    ?>

    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

  14. darrenterhune
    Member
    Posted 7 years ago #

    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.

    <?php
    phpinfo();
    ?>

    There can be security issues obviously.

  15. jdaviescoates
    Member
    Posted 7 years ago #

    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

    Thanks!

    Josef.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags