So you might notice some apps or scripts are executing slowly, and if you have the time and inclination (and access to your cpanel via your host), you might want to increase the memory limit of your php. Hayden James at haydenjames.io (not to be confused with Britney’s youngest son) has a really good explanation, which I am shamelessly using to help me pick the featured image for this post. First, think of the memory limit like a speed limit on the road – if it’s higher, you can go faster. And second, remember that the memory limit is per script, (php is not designed for multi-threading and the scripts will not share the memory limit setting) and that generally you don’t want inefficient scripts that need a lot of memory, you’d rather optimize your scripts and therefore your site. But if you do want to increase the php memory limit, here are the steps. And theoretically, things will run faster and better for you.
Remember, php is the language that runs a wordpress site in the background; html and css are what makes it look good on the front end. So if you are improving the performance on the back end, your site should load faster.
There are some ways to approach this, like the wp-config.php file and your .htaccess file. Here are a few tutorials:
- Fame Themes walks you through this and other ways to increase the memory limit for your wordpress site. They rock.
- Rocket.me also has basically the same info, also helpful and clear.
- InMotion lists a few ways to get at the memory setting, too.
- Beaver Builder has some helpful info, as well as an explanation of why you need more memory allocated to php.
Or you can edit your php.ini file.
- a phpinfo.php page is very helpful – it’s a snapshot of your php environment on your server (version, stats, server info, configuration options, etc). It will show your your php memory limit. You can generate a phpinfo.php file, if you don’t have one, very simply with the steps here. Don’t forget to delete the file when you’re done! It’s a goldmine for hackers. (another example, InMotion hosting also has their steps for generating a phpinfo.php file. Basically the same.)
- Sometime you won’t have a php.ini file. One way to generate one automagically is update your version of php (or even keep the same version number and just click update) in your php version. You may have to click around for a few minutes or search via where your host put that. But it will generate a php.ini file already populated. (here’s a couple of links for bigger hosts