How to fix  upload_max_filesize error.

While you are trying to install a theme or upload a large photo on your website you may see the following error :

The Uploaded file exceeds the upload_max_filesize directive in php.ini

Do not worry this is a small thing and i will show you how to fix it.

There are different methods to fix that error and i will show you each of them  :

1.Add the following code to your functions.php 

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

2. Edit php.ini file or create a new php.ini file

Sometimes you may not find that file on your host but if you find it , add the following code and save.

upload_max_filesize = 64M

post_max_size = 64M

max_execution_time = 300
If php.ini file doesn’t exist , create a new file and name it php.ini and  add the above code.

3. If you are using Godaddy it may look a little bit strange if the methods above doesn’t work . Do not worry i will show you how to fix it from Cpanel

Step 1 : Login in to your CPANEL 
Step 2: Under Software section click : Select PHP version
Step 3 : Click  Switch To PHP Options
Step 4:  Change upload_max_filesize to 256mb and save it
You can do the same for : max_execution_time , post_max_size
Subscribe To Our Newsletter

Subscribe To Our Newsletter


Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!