Ad Widget

Collapse

PHP Errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brismtedt
    Junior Member
    • Jul 2009
    • 22

    #1

    PHP Errors

    Hello!

    I just installed latest Zabbix (1.6.5) on a new server and I've got a bunch of PHP errors.
    The web frontend works, but shows these errors everywhere:

    Code:
    # Function ereg_replace() is deprecated[/home/.../include/page_header.php:398]
    # get_class() expects parameter 1 to be object, array given[/home/.../include/classes/ctable.inc.php:138]
    # get_class() expects parameter 1 to be object, array given[/home/.../include/classes/ctable.inc.php:144]
    # get_class() expects parameter 1 to be object, array given[/home/.../include/classes/ctable.inc.php:62]
    # get_class() expects parameter 1 to be object, array given[/home/../include/classes/ctable.inc.php:138]
    I've tried messing with php.ini file (including turning off error output completely), but nothing seems to work :-/

    Anyone got an idea?

    Information about the server:
    PHP runs as cgi-bin, its version 5.3.0 configured with:
    './configure' '--with-mysql' '--enable-bcmath' '--enable-sockets' '--prefix=/home/zabbix' '--with-gd'

    (Note: my only experience with Zabbix so far is a test installation of an older version on another server. On that server I experienced no such troubles)
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    FrontEnd is not ready for PHP > 5.2.9.
    Zabbix | ex GUI developer

    Comment

    • Brismtedt
      Junior Member
      • Jul 2009
      • 22

      #3
      I see.

      I have quite a bit of PHP experience,
      Do you accept patches if i fix those issues, or is someone already working on this?

      thanks for the clarification :-)
      /B

      Comment

      • Aly
        ZABBIX developer
        • May 2007
        • 1126

        #4
        Yes, we accept patches after reviewing and testing it.
        Zabbix | ex GUI developer

        Comment

        • Brismtedt
          Junior Member
          • Jul 2009
          • 22

          #5
          Hi!

          Using PHP 5.2.x worked a lot better..

          I've fixed some of the issus for 5.3, Ill see if I have time to complete them and send a patch..
          Most challenging parts seems to be converting posix regex to perl syntax..

          cheers

          /B

          Comment

          • Aly
            ZABBIX developer
            • May 2007
            • 1126

            #6
            Originally posted by Brismtedt
            Hi!

            Using PHP 5.2.x worked a lot better..

            I've fixed some of the issus for 5.3, Ill see if I have time to complete them and send a patch..
            Most challenging parts seems to be converting posix regex to perl syntax..

            cheers

            /B
            I haven't look at them, but this one is the first what comes to my mind
            Zabbix | ex GUI developer

            Comment

            • nickwe
              Junior Member
              • Sep 2009
              • 13

              #7
              Any news on the PHP 5.3 compatibility?

              Hi,

              My personal distribution (Arch Linux) has just passed to php 5.3 by default, so I'm getting all kind of deprecated errors, it doesn't seems to be blocking in any ways but it doesn't look nice...

              Do you have any news when the compatibility with 5.3 should be operational, my production servers are running on CentOS with php 5.2 so I'm not in a hurry.

              Also, is there a way to not display the php errors on the web interface?

              Regards,


              Nicolas.

              Comment

              • Daireishi
                Junior Member
                • Oct 2009
                • 2

                #8
                Originally posted by nickwe
                Hi,

                My personal distribution (Arch Linux) has just passed to php 5.3 by default, so I'm getting all kind of deprecated errors, it doesn't seems to be blocking in any ways but it doesn't look nice...

                Do you have any news when the compatibility with 5.3 should be operational, my production servers are running on CentOS with php 5.2 so I'm not in a hurry.

                Also, is there a way to not display the php errors on the web interface?

                Regards,


                Nicolas.
                Same issue with PHP 5.3. I'll see about going down to 5.2. I'd be happy to not have the php errors on the web interface as well. I suppose I could just look for that logging facility.

                Comment

                • richlv
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Oct 2005
                  • 3112

                  #9
                  Brismtedt, so how did it go with the patch ?
                  Zabbix 3.0 Network Monitoring book

                  Comment

                  • Daireishi
                    Junior Member
                    • Oct 2009
                    • 2

                    #10
                    PHP5.3 patch

                    Here's a patch that disables PHP logging output to the screen.

                    I looked at the errors, and they all seems to be cosmetic for now. The regular expression interface is being replaced in PHP6. The other common warning doesn't seem to have any effect either. I haven't noticed anything broken in Zabbix yet.

                    Code:
                    --- frontends/php/include/config.inc.php.orig	2009-10-06 02:53:15.000000000 +0000
                    +++ frontends/php/include/config.inc.php	2009-10-06 02:54:28.000000000 +0000
                    @@ -92,7 +92,7 @@
                     
                     	/********** START INITIALIZATION *********/
                     
                    -	set_error_handler('zbx_err_handler');
                    +//	set_error_handler('zbx_err_handler');
                     
                     	global $ZBX_LOCALNODEID, $ZBX_LOCMASTERID, $ZBX_CONFIGURATION_FILE, $DB;
                     	global $ZBX_SERVER, $ZBX_SERVER_PORT;
                    Attached Files

                    Comment

                    • nickwe
                      Junior Member
                      • Sep 2009
                      • 13

                      #11
                      Thanks, it's working perfectly with the patch :-)

                      Thanks, it's working perfectly with the patch :-)

                      Comment

                      • richlv
                        Senior Member
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Oct 2005
                        • 3112

                        #12
                        for the record, current trunk should be php 5.3 compatible for some time now (in a proper way, simply disabling warnings/errors is a quite awful hack )
                        Zabbix 3.0 Network Monitoring book

                        Comment

                        • SharkCZ
                          Member
                          • Apr 2006
                          • 39

                          #13
                          patch that fixes the get_class() warnings is attached
                          Attached Files

                          Comment

                          Working...