Ad Widget

Collapse

Cannot redeclare error() in /usr/share/zabbix/include/func.inc.php on line 1930

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blackcode
    Junior Member
    • Aug 2014
    • 5

    #1

    Cannot redeclare error() in /usr/share/zabbix/include/func.inc.php on line 1930

    Hello Gents,

    I have issue with frontend of Zabbix 3.2. I have got the following log entry in my httpd error log:

    Code:
    PHP Fatal error:  Cannot redeclare error() in /usr/share/zabbix/include/func.inc.php on line 1930
    I looked after where this funcion declared beside func.inc.php and I found:

    Code:
    grep -Ri "function error"
    
    func.inc.php:function error($msgs) {
    classes/core/CAjaxResponse.php:	public function error($error) {
    classes/html/CTag.php:	public function error($value) {
    classes/validators/CValidator.php:	protected function error($message) {
    classes/api/services/CItemGeneral.php:	protected function errorInheritFlags($flag, $key, $host) {
    classes/parsers/CUserMacroParser.php:	private function errorMessage($source, $pos) {
    classes/parsers/CItemKey.php:	private function errorMessage($key, $pos) {
    Do you have idea, what stays centre of the problem?

    Ty
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    does it cause some kind of problem ?
    can you copy

    vi /usr/share/zabbix/include/func.inc.php + 1930
    here ?

    Comment

    • Blackcode
      Junior Member
      • Aug 2014
      • 5

      #3
      Hello batchenr!

      It is the "redeclareted" function:

      Code:
      function error($msgs) {
              global $ZBX_MESSAGES;
      
              if (!isset($ZBX_MESSAGES)) {
                      $ZBX_MESSAGES = [];
              }
      
              $msgs = zbx_toArray($msgs);
      
              foreach ($msgs as $msg) {
                      $ZBX_MESSAGES[] = ['type' => 'error', 'message' => $msg];
              }
      }


      Originally posted by batchenr
      does it cause some kind of problem ?
      can you copy



      here ?

      Comment

      • batchenr
        Senior Member
        • Sep 2016
        • 440

        #4
        but does it cause some problem in zabbix server for you ?
        what is your php version ?

        php -v

        Comment

        • Blackcode
          Junior Member
          • Aug 2014
          • 5

          #5
          I have php 5.4.

          php -v
          PHP 5.4.16 (cli) (built: Aug 11 2016 21:24:59)


          I have problem with opening the frontend. Nothing happens, and I found the error in apache log.

          Comment

          • batchenr
            Senior Member
            • Sep 2016
            • 440

            #6
            and zabbix server version ?
            my php is 5.6

            Comment

            • Blackcode
              Junior Member
              • Aug 2014
              • 5

              #7
              Originally posted by batchenr
              and zabbix server version ?
              my php is 5.6
              I'm using version 3.2.1 from server and agent also.

              Comment

              Working...