How to Increase PHP Memory Limit for your WordPress Website

 

There are a number of different reasons why you might want to increase the PHP memory limit of your WordPress site, and there are few different ways to do it. We recommend reading an article from our friends over at WPMU DEV.

  1. Edit PHP.INI file.  01:55
  2. Edit .htaccess file.  03:10
  3. WP config file. 03:30

 

Read the full episode transcript below:

00:21 David: Hey everybody welcome to another episode of WP the Podcast, brought to you by WP Gears. I’m David Blackmon.

00:36 Tim: I’m Tim Strifler.

00:37 David: Today we’re going to talk about how to increase PHP memory limit for your WordPress website. A couple of things that we want to say is why David and Tim do you even want to increase the PHP memory limit? Why would I want to do this? There are a couple of reasons why. If you’ve ever tried to up load a file to your media gallery and you’ve gotten an error that says the uploaded file exceeds the upload max file size directive in php.ini, you’re gonna wanna up it. This is one reason and the second, probably most common reason would be if you’re getting a fatal error, allowed memory size of whatever bytes exhausted. You’re getting this fatal error. These are a couple of the reasons why you want to do this and Tim’s going to walk us through what we need to do.

01:30 Tim: Yeah, absolutely and it’s a little bit technical and so this is a audio only podcast obviously and so I’m not going to read the exact little snippets that you need to post in there. Instead we’re going to point you to a really good article from our friends over at WPMU DEV that talks about it and walks you through it. Essentially there’s a couple different areas that you can attempt to increase the memory limit.

01:55 Tim: The first one is there’s actually a file, it’s a hidden file and so if you’re using FTP or your file manager, you need to make sure that you have the, show hidden files turned on. It’s going to vary based off of what you’re using to look at the files. There’s a file called PHP.INI and essentially it has the PHP setting so to speak and you’ll find in there that the max file size, the post max size, memory limit, stuff like that and the memory limit will typically be at 300 megabytes or whatever, 1000 megabytes and you want to increase that. You can increase it to 3000 megabytes, which will make WordPress run more smoothly. ‘Cause you kinda think about it like a computer with Ram.

02:49 Tim: If you have a computer that’s running a lot of different things and you have low Ram, well it’s gonna bog things down. It’s gonna run really slowly, things are gonna freeze. If you have more Ram at your computer’s disposal; the random access memory, well then it’s going to run a lot better and faster when you’re doing the normal operations and the same thing goes with your WordPress website on a server. You want more PHP memory allocated to the server and so the PHP.INI that’s usually the best place to start and if that doesn’t seem to solve it, well then you can edit your .htaccess file and again, the article we’re linking has the exact things you want to paste in there to attempt to increase the limit.

03:30 Tim: The last thing you can try if that doesn’t work is your WP config file. There’s actually a WP memory limit and that’s specific to WordPress, however, you have to make sure the PHP memory limit is set to a certain limit first before you define the WordPress memory limit, because WordPress isn’t going to be able to exceed what PHP memory limit is allowed.

03:55 Tim: That’s kind of the first couple of things we want to check. Again, take a look at the article, it’s going to guide you through, show you exactly where to do it, but we want to kind of talk through those points because this is a very common thing. Especially if you’re on shared hosting, maybe cheap shared hosting, you’re gonna see that become pretty common and if you have a website that’s doing a lot of uploading and stuff like that, you’re going to hit those limits pretty quickly.

04:19 David: Tim, thanks for walking us down through the process of increasing our PHP memory limit. Check out that article on WPMU DEV, it is a great article, even if you’re a non-techy person it’s going to walk you through how to do this properly and stuff.

04:36 David: Tomorrow we’ve got another great topic, Design Trends in 2019. Tim, until tomorrow. We’ll see you then.

04:45 Tim: Take care. Bye bye.

Did you Enjoy this Episode?

  • Will you consider sharing it online? Just click one of the share buttons below!
  • Will you leave us a review? 🙂
  • Have a question, or a topic request? Let us know in the comments below!

Want to Connect with David & Tim?

1 Comment

  1. Jonaz Vaneryd

    Hi guys, really appreciate your daily dose of WP knowledge in WP The Podcast. Episode 465 on how to increase PHP memory limits was really timely. But you seem to have missed to link to the article on WPMU DEV? I can’t seem to find a link to it.

    Thanks
    /Jonaz in Sweden

    Reply

Submit a Comment

Your email address will not be published.

Where To Find Us

Listen to WP The Podcast on your favorite platform: