Ad Widget

Collapse

PHP Fatal error: Allowed memory size exhausted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mechanix
    Member
    • Jan 2017
    • 92

    #1

    PHP Fatal error: Allowed memory size exhausted

    Hi,

    Zabbix 3.2.3

    I´m receiving following error when on the graphs page all hosts are selected:

    Code:
    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /usr/share/zabbix/include/classes/macros/CMacrosResolver.php on line 1069, referer: https://<someurl>:9443/charts.php?fullscreen=0&groupid=0&hostid=10215&graphid=3268
    I have tried to increase the memory_limit in /etc/httpd/conf.d/zabbix.conf but it didn´t fix the issue.

    Any thoughts? Thank you
  • ovas
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Apr 2017
    • 138

    #2
    Hello!

    You can also try to adjust the max_execution_time PHP setting to a higher value keeping the changes done to memory_limit. What exact amount of RAM do you have specified there?

    Comment

    • Mechanix
      Member
      • Jan 2017
      • 92

      #3
      I got 16GB of RAM but I managed to solve this. Actually there were multiple php.ini files. Edited the right one and now it works, thank you

      Comment

      • jdgs
        Junior Member
        • Feb 2016
        • 14

        #4
        Originally posted by Mechanix
        I got 16GB of RAM but I managed to solve this. Actually there were multiple php.ini files. Edited the right one and now it works, thank you
        Could you please let me know exactly what you edited? I have this error and have edited a couple of files where I found entries, but still no joy.

        Comment

        • Mechanix
          Member
          • Jan 2017
          • 92

          #5
          Hi,

          I created a info.php file in /usr/share/zabbix with following content:

          HTML Code:
          <?php
            phpinfo();
          ?>
          now, point your browser to http://<your-zabbix-server/info.php

          you should see a line Loaded Configuration File

          Comment

          • jdgs
            Junior Member
            • Feb 2016
            • 14

            #6
            Originally posted by Mechanix
            Hi,

            I created a info.php file in /usr/share/zabbix with following content:

            HTML Code:
            <?php
              phpinfo();
            ?>
            now, point your browser to http://<your-zabbix-server/info.php

            you should see a line Loaded Configuration File
            Thanks for your suggestion, however the info.php pointed me to the file /etc/php5/apache2/php.ini as the loaded config file. I looked in this file and I have already increased the memory limit to 512M, but still I get the error message. See below:

            Code:
            ; Maximum amount of memory a script may consume (128MB)
            ; http://php.net/memory-limit
            memory_limit = 512M

            Comment

            • jdgs
              Junior Member
              • Feb 2016
              • 14

              #7
              Ok, so an update on this...

              Basically went through and grepped the whole appliance for the string "memory_limit". Found some other files and updated these and after restart, the Latest Data page now loads.

              However, it takes an obscene amount of time to load. Either loading the latest data page, or performing a search, takes around 20seconds to return results, even if the result is only one item. All other pages load within a second.

              We are running the Zabbix appliance on 3.0.9, and relatively small deployment at present - monitoring 140 hosts.

              Comment

              • Mechanix
                Member
                • Jan 2017
                • 92

                #8
                Hi,

                so basically the php variable can only be overwritten in

                HTML Code:
                /etc/httpd/conf.d/zabbix.conf
                Check that file.


                Cheers

                *edit* just to make sure: you restarted the webserver after the change right?
                Last edited by Mechanix; 12-07-2017, 18:12.

                Comment

                • Mechanix
                  Member
                  • Jan 2017
                  • 92

                  #9
                  Originally posted by jdgs
                  Ok, so an update on this...

                  Basically went through and grepped the whole appliance for the string "memory_limit". Found some other files and updated these and after restart, the Latest Data page now loads.

                  However, it takes an obscene amount of time to load. Either loading the latest data page, or performing a search, takes around 20seconds to return results, even if the result is only one item. All other pages load within a second.

                  We are running the Zabbix appliance on 3.0.9, and relatively small deployment at present - monitoring 140 hosts.
                  That´s strange. Are you able to update the zabbix server to the latest version?

                  BTW: how much RAM does the server have?
                  Last edited by Mechanix; 12-07-2017, 18:30.

                  Comment

                  Working...