1

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.

  • 2
    Your hosting company's support staff should be able to help you. – Salman A Nov 19 '19 at 08:21
  • Possible duplicate of [How can I increase max file upload in Wordpress?](https://stackoverflow.com/questions/16156069/how-can-i-increase-max-file-upload-in-wordpress) – Anas Nov 19 '19 at 08:28

1 Answers1

1

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.

Md. Abu Taleb
  • 1,486
  • 1
  • 12
  • 23