phpwordpresswp-adminupload-max-filesize

Wordpress PHP.INI nightmare


I tried uploading a theme and i got the error

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

First, I couldn't find a php.ini file, then I sought help and I was told to create it which I did and also edited. Till date, Nothing has changed. Same error. I created the php.ini file in the public_html directory, no luck. In the public_html/wp-admin directory, no luck as well. Please help. Thanks.


Solution

  • php.ini is the core configuration of PHP. It's located on the server. You can change upload_max_filesize from php.ini files.

    If you don't have the access of php.ini files then you can create a .htaccessfile (not needed if already have) in the project directory. Because .htaccess the file can overwrite the main php.ini config.

    After create .htaccess put the following line in .htaccess

    php_value upload_max_filesize 100M
    php_value post_max_size 100M 
    

    Note

    If you have cPanel access, many cPanel provide the opportunity to change the upload_max_filesize from cPanel configuration.

    Hope it will help.