How To Change PHP Memory Limit in cPanel

Getting a PHP Memory Limit Error? You’ve come to the right place! 

code

Most of the time, this error happens when you install and activate themes or upload heavy images. Don’t sweat it though, because it can be easily mitigated.

Read on to learn in detail about how to adjust your memory limit in cPanel. But first, let’s get some definitions out of the way for people who may not be familiar with all of this stuff. 

What is cPanel

CPanel is a popular web hosting control panel. It simplifies the process of hosting a website through its graphical interface and automation tools. Some of the many things you can do with cPanel is publish websites, organize web files, manage domains, and create email accounts.

cPanel is not free, however, web hosting companies usually supply it to their customers as part of their hosting package.

People like cPanel because it’s easy to learn, easy to use, saves time and money, is tried and tested (most developers are well acquainted with it), includes software auto-installers, and there are plenty of tutorials and support available online. 

Also Read: cPanel vs. Plesk: What Is the Difference?

What is PHP Memory

PHP is a popular open-source, general-purpose scripting language that people use for web development. It comes with default settings for things such as memory. These settings are appropriate for most websites, however you are able to change them need be. 

Changing Memory Limit in CPanel

To change your PHP memory limit, you need to use a text editor to adjust the memory_limit directive in your php.ini file. Let’s walk you through it from start to finish. 

  1. Log in to your cPanel account. 
  2. On your dashboard, go to the Software section and click on Select PHP version.
  3. Now you’re on an interface where you can change the PHP version and extensions. You should see a button that says Switch To PHP Options
  4. You should then be able to change the value with a dropdown menu or text input box. You’ll be able to change it to anywhere from 64M to 1024M. For most sites, 128MB is more than enough unless your plugin/theme demands more.
  5. Make sure you save your changes and it will be automatically updated.

Keep in mind, depending on your host, your cPanel may look a little different. Hopefully, these instructions were somewhat helpful in adjusting the PHP memory limit in cPanel to your liking. 

Scott Poole

Scott Poole

With over a decade of experience in building websites, Scott has seen it all... bodged website migrations, nightmare web hosts, ridiculous customer support, etc. He decided to centralise all his knowledge on 28msec to guide and help people find the best host possible.