• Resolved sjspain

    (@sjspain)


    I had my WP installation set up to allow media uploads of upto 48M. This worked fine, but since about mid March I’ve been unable to upload anything larger than 2M.

    Anything larger than 2M now gives the error – The uploaded file exceeds the upload_max_filesize directive in php.ini

    I had put a php.ini in the top level directory with the following:

    max_input_time = 900
    upload_max_filesize = "48M"
    post_max_size = "48M"
    memory_limit = "500M"

    phpinfo() shows the values are picked up correctly.

    I’ve also put the following in the functions.php of my child theme:

    add_filter( 'upload_size_limit', 'hwmc_change_upload_size');
    
    function hwmc_change_upload_size()
    {
        return 48 * 1024 * 1024;
    }

    I’ve tried deactivating all plug-ins, but the problem persists.

    Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sjspain

    (@sjspain)

    WP is installed under /blog so I tried running phpinfo() in that directory and found it return the default (2M) values.

    Copied the php.ini from / to /blog, but this has had no effect.

    Why would php.ini not be effective in sub directories?

    Have you spoken to your hosts about this? The use of custom php.ini files – especially in sub-folders – varies from host to host.

    Thread Starter sjspain

    (@sjspain)

    Thanks Esmi
    I was hoping to get something a bit more concrete before going to my host – some hosts have sloping shoulders and would blame anything but their set up.

    As it happens I think my host must have changed something, but I’ve found a solution.

    If the php.ini settings aren’t being inherited by sub directories then you can add the following line to the.htaccess file (which is under public_html folder). This solved my problem.

    SetEnv PHPRC /home/username/public_html (path of php.ini file)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Large media uploads have started giving error’ is closed to new replies.