Ad Widget

Collapse

php gd version issue while installing Zabbix 5 alpha 2 on Centos 7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ulinx
    Junior Member
    • Feb 2020
    • 9

    #1

    php gd version issue while installing Zabbix 5 alpha 2 on Centos 7

    Hi

    I am trying to install Zabbix 5 alpha 2 on Centos 7.7 fully updated. I am following official instructions at
    Zabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!


    All goes fine until step h when i have to go to the frontend and configure the missing elements, there on the pre check part I got this error

    PHP gd extension missing (PHP configuration parameter --with-gd).

    Current Required
    PHP gd 2.1.0 2.2 Fail
    I cannot get forward, I created an small php file to get the actual version of gd component an indeed it is version 2.1

    [root@zabbix5-test ~]# cat test.php
    <?php

    var_dump(gd_info());
    ?>
    [root@zabbix5-test ~]# php test.php
    array(13) {
    ["GD Version"]=>
    string(26) "bundled (2.1.0 compatible)"
    ["FreeType Support"]=>
    bool(true)
    ["FreeType Linkage"]=>
    string(13) "with freetype"
    ["GIF Read Support"]=>
    bool(true)
    ["GIF Create Support"]=>
    bool(true)
    ["JPEG Support"]=>
    bool(true)
    ["PNG Support"]=>
    bool(true)
    ["WBMP Support"]=>
    bool(true)
    ["XPM Support"]=>
    bool(true)
    ["XBM Support"]=>
    bool(true)
    ["WebP Support"]=>
    bool(true)
    ["BMP Support"]=>
    bool(true)
    ["JIS-mapped Japanese Font Support"]=>
    bool(false)
    }
    [root@zabbix5-test ~]#

    I was thinking on using a newer php version, but after seeing dependencies for package zabbix-web-mysql-scl I saw it is tied to php 7.2 so php 7.3 won't work

    Any idea on how to fix this will be welcome.

    Thank you
  • ulinx
    Junior Member
    • Feb 2020
    • 9

    #2
    Hi I have just tried to do the same but this time using rh-php73-* packages instead of rh-php72-* ones, then I forced the zabbix-server installation packages, I also needed to copy and modify some configurations files for the rh-php73-php-fpm service.
    I was able to get the zabbix web setup page, but exactly the same error stopped me from going further...
    So in rh-php73 the gd module has the same version as in php 72 and that is lower than the version required for Zabbix to successfully complete

    Comment

    • killerliz
      Junior Member
      • Feb 2020
      • 7

      #3
      Same here.

      I tried to use rh-php74 and the same error occurred.

      Strange thing is that in the pre check setup it showed this:
      PHP version 7.2.24 7.2.0 OK
      Even though PHP7.4 is installed.

      Base is CentOS7.8

      Anyway to get around with this?

      Comment


      • ulinx
        ulinx commented
        Editing a comment
        I am suspecting two things:
        1- A developer put by mistake a request for something that does not exist AKA GD 2.2 when he/she should mean 2.1
        2- During test internal test in Zabbix dev they did not used a clean/installed from scratch PC to perform the install.

        And I am highly suspecting on 2 because I also tried Zabbix 5 alpha 2 in Centos 8 and got a dependency error for libssl2 and that library does not exist on Centos 8 repository. I will open a different post for that next Monday
    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #4
      Thanks for posting about this. My site is using RHEL 7.7 for our Zabbix server, so it means I'm going to run into the same issue when we want to upgrade to Zabbix 5.x.

      PHP 7.4 is out, which means that eventually there will be Software Collections for RHEL 7 for rh-php74-*. The question is whether Zabbix 5.0 will support PHP 7.4 and whether rh-php74-* will have an updated GD extension.

      Comment

      • ulinx
        Junior Member
        • Feb 2020
        • 9

        #5
        Yeah, you will get same issue and I am not sure if new GD will have the required version. I have just re tested all that I have done in a brand new PC, installed from scratch and got the same issue. If PHP 7.4 get added to software collections in the next few weeks I can try it to see if it works with Zabbix or we can wait for an official statement from the Zabbix development team

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #6
          If you do eventually test rh-php74, please do report back here.

          Red Hat's documentation for Software Collections say that collections are released "semi-annually". SCL 3.4 was just released in December 2019, so we probably won't see SCL 3.5 (or perhaps 4.0) until May, June, or July of 2020. That would be the earliest that I would guess PHP 7.4 would be available in a collection.

          As you've said, even if PHP 7.4 is available in a collection, that doesn't guarantee it will have a new enough GD.

          Even RHEL 8.1 doesn't currently have an AppStream for PHP 7.4, so even rebuilding the Zabbix server on RHEL 8.1 might not get a new enough php gd.

          Comment

          • killerliz
            Junior Member
            • Feb 2020
            • 7

            #7
            Thinking this could be related to Centos issue, I used my RPI2 with Raspian Buster os, and this occured in the "Configure DB connection"...

            Cannot connect to the database.
            • The frontend does not match Zabbix database. Current database version (mandatory/optional): 4050035/4050035. Required mandatory version: 4050027. Contact your system administrator.

            I found other forum that mentioned it could be due to caching on the browser, but I tried other web browser and the same thing happened. I left it for a day to let the RPI have some time to process whatever it needs, but the same error message happens...

            Not too sur how to proceed from there on...

            Comment


            • ulinx
              ulinx commented
              Editing a comment
              Ok, so PHP-Gd seams to be Centos related, as it looks like you pass that check/screen, can you please confirm your PHP version and GD version, please, on my first post there is a small php script to get the GD version maybe you want to use it.
          • killerliz
            Junior Member
            • Feb 2020
            • 7

            #8
            in my RPI, it looks like this Check of pre-requisites

            PHP version 7.3.14-1~deb10u1 5.4.0 OK
            PHP option "memory_limit" 128M 128M OK
            PHP option "post_max_size" 16M 16M OK
            PHP option "upload_max_filesize" 2M 2M OK
            PHP option "max_execution_time" 300 300 OK
            PHP option "max_input_time" 300 300 OK
            PHP option "date.timezone" Asia/Singapore OK
            PHP databases support MySQL OK
            PHP bcmath on OK
            PHP mbstring on OK
            PHP option "mbstring.func_overload" off off OK
            PHP sockets on OK
            PHP gd 2.2.5 2.0 OK
            PHP gd PNG support on OK
            PHP gd JPEG support on OK
            PHP gd GIF support on OK
            PHP gd FreeType support on OK
            PHP libxml 2.9.4 2.6.15 OK
            PHP xmlwriter on OK
            PHP xmlreader on OK
            PHP LDAP on OK
            PHP ctype on OK
            PHP session on OK
            PHP option "session.auto_start" off off OK
            PHP gettext on OK
            PHP option "arg_separator.output" & & OK

            The output from the test script

            array(13) {
            ["GD Version"]=>
            string(5) "2.2.5"
            ["FreeType Support"]=>
            bool(true)
            ["FreeType Linkage"]=>
            string(13) "with freetype"
            ["GIF Read Support"]=>
            bool(true)
            ["GIF Create Support"]=>
            bool(true)
            ["JPEG Support"]=>
            bool(true)
            ["PNG Support"]=>
            bool(true)
            ["WBMP Support"]=>
            bool(true)
            ["XPM Support"]=>
            bool(true)
            ["XBM Support"]=>
            bool(true)
            ["WebP Support"]=>
            bool(true)
            ["BMP Support"]=>
            bool(true)
            ["JIS-mapped Japanese Font Support"]=>
            bool(false)
            }

            Comment

            • ulinx
              Junior Member
              • Feb 2020
              • 9

              #9
              Interesting.... you are using Debian or something similar and your GD version is 2.2.5 and your Zabbix 5 requires 2.0
              But in Centos 7 and php rh-php73 GD version is 2.1 but Zabbix 5 requires 2.2.
              This points to a typo on the requirements for Centos version, it makes no sense to me having a php req for each distribution...

              Please if we have any Zabbix developer here please some input on this would be appreciated

              Comment

              • killerliz
                Junior Member
                • Feb 2020
                • 7

                #10
                Indeed it is Debian, as the OS in the Raspberry Pi Is Raspian Buster, a Debian derivative.

                Really need someone from the Dev team to assist us further....

                Comment

                • ulinx
                  Junior Member
                  • Feb 2020
                  • 9

                  #11
                  Also I have just confirmed that in Centos 8 zabbix 5 alpha 2 needs an extra library not present on the official repos to get installed, so either requires are bad or we are missing an step on the instructions...
                  I will be opening a new post for that...

                  Comment

                  • Atsushi
                    Senior Member
                    • Aug 2013
                    • 2028

                    #12
                    If you use remi's PHP 7.4 package on CentOS 7.7.1908, you can run Zabbix 5.0.0alpha2. However, it cannot be installed with packages that depend on the latest SCL. I'm sure that Zabbix web frontend can work by installing and adding configuration to the application, rather than installing it in a package.
                    If you only want to build a PHP environment, you can build it with the following procedure.

                    ex.
                    Code:
                    # yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
                    # yum --enablerepo=remi-php74 install php php-gd php-bcmath php-mbstring php-xml php-ldap php-mysqlnd php-pecl-mysql
                    If there is no libssh2-devel on CentOS 8.1 when building, try changing to using libssh instead of libssh2. After installing the libssh-devel package, specify --with-ssh instead of --with-ssh2 when executing Zabbix conifgure.
                    If you use the spec file to build the rpm, you can change the dependencies as well.

                    If you want to install the package for RHEL 8 on Zabbix official repository on CentOS 8.1 as it is, you can also install by installing the library package for CentOS 8.0.

                    ex.
                    Code:
                    # yum install http://repo.zabbix.com/zabbix/4.5/rhel/8/x86_64/zabbix-release-4.5-2.el8.noarch.rpm
                    # yum install http://mirror.centos.org/centos/8.0.1905/AppStream/x86_64/os/Packages/libssh2-1.8.0-8.module_el8.0.0+189+f9babebb.1.x86_64.rpm
                    # yum install zabbix-agent zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf

                    Comment

                    • ulinx
                      Junior Member
                      • Feb 2020
                      • 9

                      #13
                      Hi Atushi, that was what I did, (extra) installing libssh2 to get Zabbix5 alpha 2 working on Centos 8. That part is working, maybe just need to be more clear on the instructions for Alpha3 release.
                      Going back to Centos 7 I will try later to check if with php7.4 we get the required GD version for Zabbix.

                      Thank for replaying on my posts..

                      Comment

                      • Atsushi
                        Senior Member
                        • Aug 2013
                        • 2028

                        #14
                        I checked the source of the development version yesterday(pre-zabbix-5.0.0beta1-ecba7e6ea5.tar.gz). The required versions of PHP gd and PHP libxml seem to have changed.

                        Code:
                        $ diff -Nru zabbix-5.0.0alpha2/frontends/php/include/classes/setup/CFrontendSetup.php zabbix-5.0.0beta1/frontends/php/include/classes/setup/CFrontendSetup.php
                        --- zabbix-5.0.0alpha2/frontends/php/include/classes/setup/CFrontendSetup.php   2020-02-17 21:06:55.000000000 +0900
                        +++ zabbix-5.0.0beta1/frontends/php/include/classes/setup/CFrontendSetup.php    2020-02-26 09:04:18.000000000 +0900
                        @@ -31,8 +31,8 @@
                                const MIN_PHP_UPLOAD_MAX_FILESIZE = '2097152'; // 2 * ZBX_MEBIBYTE;
                                const MIN_PHP_MAX_EXECUTION_TIME = 300;
                                const MIN_PHP_MAX_INPUT_TIME = 300;
                        -       const MIN_PHP_GD_VERSION = '2.2';
                        -       const MIN_PHP_LIBXML_VERSION = '2.9';
                        +       const MIN_PHP_GD_VERSION = '2.0';
                        +       const MIN_PHP_LIBXML_VERSION = '2.6.15';
                                const REQUIRED_PHP_ARG_SEPARATOR_OUTPUT = '&';
                        
                                /**
                        $

                        Comment

                        • ulinx
                          Junior Member
                          • Feb 2020
                          • 9

                          #15
                          Ok, that reduction to GD 2.0 will work for sure...!!!

                          Thank you...

                          Comment

                          Working...