• Maelig

    (@maelig)


    Hi,

    I’m trying to upload > 2MB files to the plugin and content WP directories. When I try to do so I get this error message :

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

    Pretty straightforward – so I edited /etc/php5/cli/php.ini to read :
    upload_max_filesize = 10M
    When that didn’t work I also added this to my site’s root folder .htaccess file :
    php_value post_max_size 20M
    Despite this I’m still getting the same error message. Any idea why that would be? I don’t know if this is relevant but the server is running on Nginx.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Maelig

    (@maelig)

    Sorry this is the relevant line in .htaccess :
    php_value upload_max_filesize 10M

    WebPrezence

    (@webprezence)

    There are 3 ways to go about this.

    • Edit your wp-config.php
    • Edit your functions.php (hopefully you have a child theme)
    • Edit your web host’s php.ini if you’re not on a shared server

    Here is the code to edit your wp-config.php:
    define(‘WP_MEMORY_LIMIT’, ‘128M’);

    Here is the code to edit your functions.php:
    /* Set memory limits */
    @ini_set( ‘upload_max_size’ , ‘128M’ );
    @ini_set( ‘post_max_size’, ‘128M’);
    @ini_set( ‘max_execution_time’, ‘300’ );

    If nothing works, contact your web hosting provider. Here is some more information:

    http://www.elegantthemes.com/blog/tips-tricks/is-the-wordpress-upload-limit-giving-you-trouble-heres-how-to-change-it

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘upload_max_filesize directive in php.ini’ is closed to new replies.