Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Suricata-related PHP errors are being displayed.

    Scheduled Pinned Locked Moved IDS/IPS
    4 Posts 3 Posters 599 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Yet_learningPFSenseY
      Yet_learningPFSense
      last edited by

      I am using suricata and now I was getting this error in PFsense. I have set a size limit for the suricata log directory as a workaround, but is there some other setting that could resolve this?

      check this option : Log Directory Size Limit Enable Directory Size Limit

      ErrorMessage is below :

      Crash report begins. Anonymous machine information:

      amd64
      12.3-STABLE
      FreeBSD 12.3-STABLE RELENG_2_6_0-n226742-1285d6d205f pfSense

      Crash report details:

      PHP Errors:
      [03-Feb-2023 15:01:51 Asia/Tokyo] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 493511028 bytes) in /usr/local/www/suricata/suricata_logs_browser.php on line 58

      1 Reply Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire
        last edited by SteveITS

        @yet_learningpfsense The PHP memory size is related to PHP not being able to read in the log file.

        https://forum.netgate.com/topic/149695/suricata-error-php-fatal-error-allowed-memory-size-of-536870912-bytes-exhausted-tried-to-allocate-540538808-bytes-in-usr-local-www-suricata-suricata_logs_browser-php-on-line-54

        How big are your log files getting, how fast?

        Here's a thread that talks about increasing the PHP limits:
        https://forum.netgate.com/topic/142702/allowed-memory-size-exhausted
        ...though it's probably preferable to get the logging under control.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote 👍 helpful posts!

        1 Reply Last reply Reply Quote 0
        • bmeeksB
          bmeeks
          last edited by

          When you view logs using the tools under LOGS VIEW, the package attempts to load the entire log file into an in-memory string. That's just how PHP works by default. But if the log file is too large, then there is not enough free PHP memory to hold the file's contents and the error you see is thrown.

          The only fix is to either view the log using an external editor, or enable all the log rotation and size limit options on the LOGS MGMT tab. Simply enabling the Directory Size Limit is not enough if your individual files are getting huge. You need to enable the log file size limits as well.

          The amount of memory available for PHP is hard-coded. It does not matter how much free RAM you may have on your firewall, PHP is configured to use about 512 MB as its limit.

          1 Reply Last reply Reply Quote 0
          • Yet_learningPFSenseY
            Yet_learningPFSense
            last edited by

            SteveITS , >>bmeeks
            Thanks for the reply. As you indicated, I've set the log directory size limit and the error message no longer appears! I will continue to use this device, thank you both.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.