Bug #16223
closedPHP Fatal error Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes)
0%
Description
Crash report begins. Anonymous machine information:
amd64
15.0-CURRENT
FreeBSD 15.0-CURRENT #1 RELENG_2_8_0-n256081-401ec5f685b9: Wed May 21 23:53:51 UTC 2025 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_8_0-main/obj/amd64/0q9vjGjc/var/jenkins/workspace/pfSense-CE-snapshots-2_8_0-main/sources/FreeBSD-src-RE
Crash report details:
PHP Errors:
[01-Jun-2025 15:37:37 America/Chicago] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
No FreeBSD crash data found.
Files
Updated by Troy R 11 days ago
- File PlfBlockerNG Update.log PlfBlockerNG Update.log added
I had disabled PFBlocker and didn't have the error when restarting unbound.
Turned PFblocker back on. Had it update. And as soon as it was done, when I go back to the dash I see a crash notice....
```
Crash report begins. Anonymous machine information:
amd64
15.0-CURRENT
FreeBSD 15.0-CURRENT #1 RELENG_2_8_0-n256081-401ec5f685b9: Wed May 21 23:53:51 UTC 2025 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_8_0-main/obj/amd64/0q9vjGjc/var/jenkins/workspace/pfSense-CE-snapshots-2_8_0-main/sources/FreeBSD-src-RE
Crash report details:
PHP Errors:
[01-Jun-2025 17:25:09 America/Chicago] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/bin/kea2unbound on line 528
No FreeBSD crash data found.
```
I also noticed in the PfBlocker log...
`Database Sanity check [ FAILED ] * These two counts should match! *
------------
Masterfile Count [ 221951 ]
Deny folder Count [ 221950 ]`
Updated by Troy R 11 days ago
So aftering giving stuff in ChatGPT to lookout from that error and my log PlfBlockerNG Update.log
It told me...
```
You’re loading very large lists:
BLP_Malware: 435K entries
BLP_Phishing: 190K entries
BLP_Redirect: 108K entries
Total count: likely over 1.5 million entries```
So I disabled those...
Then after a while it had me go into:
Go to:
System → Advanced → System Tunables
Then:
Add or edit:
Tunable: php_memory_limit
Value: 2048
Description: (“Increase PHP Memory”)
```
So I did that. And rebooted the router..
I then noticed in `/conf/config.xml` that I had a new thing
```
<sysctl>
<item>
<tunable>php_memory_limit</tunable>
<value>2048</value>
<descr><![CDATA[Increase PHP Memory]]></descr>
</item>
</sysctl>
```
And then I rebooted.. And nothing changed..
So it said to move it from a to <sysctl> to a <system>
So I removed that thing from the bottom from the system tunable I made.
And then moved up into the system area at the top and added in
```
...
</user>
<nextuid>2010</nextuid>
<nextgid>2000</nextgid>
<timezone>America/Chicago</timezone>
<php_memory_limit>2048</php_memory_limit>
<time-update-interval>300</time-update-interval>
<timeservers>162.159.200.123 time4.google.com time5.facebook.com time.cloudflare.com time.google.com pool.ntp.org</timeservers>
```
I put that memory limit just in that area of that system then...
Then I ran `/etc/rc.php_ini_setup` so it regens the php config..
And now when I run
`php -i | grep memory_limit`
I get
`memory_limit => 2048M => 2048M`
Now to see if I still have that error if I try again with my pfblocker update...
Updated by Troy R 11 days ago
After doing all that I now learned..
System > Advanced > Miscellaneous > PHP Settings is exactly what sets the <php_memory_limit> tag inside the <system> block of your config.xml
So the issue that looked like an kea2unbound issue. That this error it made should maybe to editing to say to go into your System > Advanced > Miscellaneous and raise the PHP Memmory Limit ....
Updated by Steve Wheeler 11 days ago
- Project changed from pfSense to pfSense Packages
- Category changed from DNS Resolver to pfBlockerNG
- Priority changed from Very High to Normal
- Release Notes deleted (
Default)
What you should be doing here is setting pfBlockerNG to use Unbound mode if you are loading a lot of large lists.