Mitigating Pi-hole ISE 500 Error on the "Long term data - Query Log"

Published 2020-06-07 on Matthew's Blog

When selecting a large date range on the long term data Query Log, say last 30 or even last 7 days, I’d be greeted with the following error message and some more information in Lighttpd’s logs.

'An unknown error occurred while loading the data.' alert dialog

And the relevant line in /var/log/lighttpd/error.log:

2020-06-07 19:40:24: (mod_fastcgi.c.421) FastCGI-stderr: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes) in /var/www/html/admin/api_db.php on line 422

I’m running Pi-hole on an old desktop system with greater resources than the Raspberry Pis I own. That box has 4GB RAM.

Once I increased the memory limit in the relevant php.ini, the Internal Server Error 500 went away.

  • I noticed when I increased the memory_limit to 512M, I had better luck loading the last 7 days worth of data.
  • I was successfully able to see the last 30 days worth of data by giving PHP a whopping limit of 2G!
  • Data from “all time” is still unavailable to me, I don’t have the RAM available to let PHP use all of it.

According to this post on the Pi-hole discourse, the next major version of Pi-hole will have a new, more clever, API.

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~mjorgensen/ [mailing list ettiquette]

Articles from blogs I follow around the net

Software engineers solve problems

Software engineers solve problems. A problem you may have encountered is, for example, “this function has a bug”, and you’re probably already more or less comfortable solving these problems. Here are some other problems you might encounter on the way: Actua…

via Drew DeVault's Blog August 17, 2020


I've been thinking a lot about what togetherness means in these lonely times. The rare times I'm with people feel illicit; a stolen moment of connection even as we try to mitigate the risk of spreading COVID-19 and do our best we can to help. I fe…

via - Posts June 26, 2020

Indie Sticker Pack

I’m super bummed right now. Normally, I’d be freshly back from WWDC, reinvigorated and ready to take on a new year of development. But thanks to COVID-19 ruining… gestures wildly… I’ve missed out on seeing so many of my friends from across the world in Califo…

via Liss is More June 17, 2020

Generated by openring

Recent Posts

Hi there!

I'm a systems administrator, front-end and back-end developer, and an IT guru in Minneapolis, MN. It’s nice to meet you.