# How do I increase PHP's memory?

**URL:** https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170
**Category:** Community Help
**Created:** [August 13, 2020, 6:10pm UTC](https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170 "2020-08-13T18:10:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fellipec](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/fellipec/32/17889_2.png) [@fellipec](https://discourse.pi-hole.net/u/fellipec)
#### Post date: [August 13, 2020, 6:10pm UTC](https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170/1 "2020-08-13T18:10:46Z")

</div>

I got the same error, while trying to query for the last 7 days.

 ![](https://discourse.pi-hole.net/uploads/default/original/3X/a/2/a25e3dd4fc6ea2beaf8bd6946005763481cf6cd4.png)

The logs show this:

 ![](https://discourse.pi-hole.net/uploads/default/original/3X/7/1/713028f78e40fec1d28d44735c3bacb1aa4ce20d.png)

The computer has 2GB. There is 1.3GB available:

 ![](https://discourse.pi-hole.net/uploads/default/original/3X/3/e/3e4751ed92fd843cbf234f23b9c629363099090e.png)

There is also a lot of swap available:

 ![](https://discourse.pi-hole.net/uploads/default/original/3X/a/4/a4e34a16e5c30896bc9ef228212c794518de1897.jpeg)

Here is my debug token if helps [https://tricorder.pi-hole.net/pv8rsyd4lh](https://tricorder.pi-hole.net/pv8rsyd4lh)

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [August 13, 2020, 9:32pm UTC](https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170/2 "2020-08-13T21:32:11Z")

</div>

Increase the amount of memory to PHP, you've got plenty to spare.

---

<div class="post-metadata">

### Author: ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)
#### Post date: [August 13, 2020, 9:41pm UTC](https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170/3 "2020-08-13T21:41:14Z")

</div>

```auto
pi@ph5:~ $ sudo nano /etc/php/*/cgi/php.ini
[..]
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M
[..]

```

* * *

```auto
pi@ph5:~ $ sudo service lighttpd restart
pi@ph5:~ $

```

* * *

```auto
pi@ph5:~ $ php-cgi -i | grep memory_limit
<tr><td class="e">memory_limit</td><td class="v">128M</td><td class="v">128M</td></tr>

```

---

<div class="post-metadata">

### Author: ![fellipec](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/fellipec/32/17889_2.png) [@fellipec](https://discourse.pi-hole.net/u/fellipec)
#### Post date: [August 14, 2020, 2:38pm UTC](https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170/4 "2020-08-14T14:38:33Z")

</div>

Thanks for the help! I found the php.ini file and after increasing it to 512M and restarting the lighttpd as you show the problem was gone.

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [September 4, 2020, 2:49pm UTC](https://discourse.pi-hole.net/t/how-do-i-increase-phps-memory/37170/5 "2020-09-04T14:49:26Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
