Browsing Category


Cpanel, How to, How to Fix, WordPress,

How to Increase the Maximum Upload and PHP Memory Limit in WordPress

#1 The uploaded file exceeds the upload_max_filesize directive in php.ini
#2 Fatal error: Allowed memory size of 12345678 bytes exhausted (tried to allocate 2345678 bytes) in /home/your-username/public_html/wp-includes/plugin.php on line 1000
Today I have started this post with most common problem at new freelancer, Web Design, Especially WordPress Developer. When you start run a robust site full of rich content. You face this  big problem that your limits are reached. You see that an error message come looks like above tow messages. But from my experiences, Sometime I face this problem when my clients like yo give me new big size WordPress Premium Theme, like BeTheme, Avada Theme, X-Theme In the first time of my learning and freelancing career I have to lost much time to fix this problem.  But by the time I have created very effective solution that must work.
So let’s start learn, How to Fix or How to Increase the Maximum Upload and PHP Memory Limit in WordPress

#1 Updating Your php.ini File

Login your hosting account, actually it popularly known as cPanel. Then go to the Files section and click on the File Manager button. Click the checkbox for Show Hidden Files and then click Go.

Open your  wp-admin folder and find a file called php.ini or php5.ini. If you don’t see it, create one by clicking the New File button in the top left-hand corner. Name the file php.ini and click the Create File button on the pop-up.

increase php memory limit htaccess wordpress

After following these instructions if php.ini  file doesn’t work,  then try renaming the file to php5.ini. Once the file is open, add or edit the following lines and then save and close.

The M means megabytes. Change the 1000M, 2000M and 3000M limit to the value with which you feel most comfortable. Changing the value of max_execution_time will limit the amount of time spent loading a script in seconds.

In many cases, the values you enter should get larger as you go down the list from lines one to three. The upload_max_filesize should be the smallest while memory_limit should be the largest. The median should be post_max_size.

Before checking to see if the error is gone, clear your browser’s cache.

#2 Editing Your .htaccess File

If  your php.ini file doesn’t do the trick, try editing your .htaccess file and add or edit the following code at the very bottom:

Editing this code is similar we did in the above php.ini file. Change the values to limits that best suit as your needs. Don’t forget to save when you’re done and clear the cache for your browser.

#3 Edit Your wp-config.php File

If this issue not fixed yet by  both of these Number 1 and Number 2, try editing your wp-config.php file, adding the following to the very bottom,

Please note, this has to be put before wp-settings.php inclusion.

Bonus for you – Changing the Limits in WHM

If your site is hosted on a VPS or dedicated server, you can try changing the upload and memory limits in your WHM.

Login your account, go to Server Configuration > Tweak Settings > PHP.

Changing the Limits in WHM

Use the same numbers you tried previously for the best possible results.

Enter in the numbers that work for you and click Save at the bottom of the page.

Next, go to Service Configuration > PHP Configuration Editor. Scroll down until you find the core sections memory_limit and upload_max_filesize

Enter the correct values for your setup. Finally, in the Options & Information section, locate max_execution_time and update it to the same value you tried in your php.ini and .htaccess files.

Click Save at the bottom of the page and clear your browser’s cache.


You’re all set now to resolve the error messages. Enjoy uploading larger files and continue using plugins on your WordPress site. These changes shouldn’t take more than a few minutes to take effect so you can quickly get back to work. If you need more help don’t delay to ask me. I am here ready to give easy guideline. Just comment or send message me. I will beck you asap. Message Now .

Interested to know more about me also Fandu Design, Visit this page : Visit Now

Don’t forget to  bookmark and share this code with others new learner like you.