Ad Widget

Collapse

How to resolve PHP72 and RH-PHP72 conflict issue for Zabbix 5.0 Upgrade

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luqing
    Junior Member
    • Feb 2019
    • 6

    #1

    How to resolve PHP72 and RH-PHP72 conflict issue for Zabbix 5.0 Upgrade

    My zabbix server (4.4) runs on Oracle linux 7.5. Currently, I already have PHP7.2 installed (but not the red-hat version). When I try to upgrade the zabbix front end to 5.0, it requires the rd-php7.2 version. Do I have to install also the rh-php72 also? will two different flavor of PHP7.2 cause conflict? or do I need to un-install current php? If un-install, will it break the existing installtion? How to resolve the conflict?

    Thanks,
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Did you read through the upgrade notes for the front-end with RHEL 7? https://www.zabbix.com/documentation...ntend_on_rhel7

    Based on that documentation, specifically the part about "Using Third Party PHP Repositories", it appears that it is possible to use PHP from some other provider, rather than SCL. When you're trying to upgrade, are any of the packages you are installing named so that they include '-scl' at the end? If so, that's probably what's causing the dependencies on the Software Collections Library (SCL) packages from Red Hat.

    Without knowing where your PHP 7.2 packages came from (Remy?) or how they are built, it's not possible to know if you can have both it and rh-php7.2* installed at the same time. You probably could, since the SCL packages are specifically organized to not conflict with any base OS paths. Still, it doesn't really make sense to have 2 different types of PHP 7.2 packages installed. That's just going to cause confusion.

    If you choose to switch to the rh-php72 packages, just be advised that you will need to customize its PHP settings (which will be under /etc/opt/rh/rh-php72/) with any changes that you made to your previous PHP's config. Also, remember that if you use PHP-FPM, the service name will have 'rh-php72' prefixed to it (so it would be rh-php72-php-fpm.service).

    Comment

    • mkihr
      Junior Member
      • Aug 2020
      • 4

      #3
      Hello!
      But in the part "Using Third Party PHP Repositories" is nothing written how to do that. You wrote to use packages without -scl at the end. Where are those packages? I searching through the documentation now for a while, but running in circles.

      Comment

      • mkihr
        Junior Member
        • Aug 2020
        • 4

        #4
        Since I cannot update the last pots:

        My problem is, that I have RedHat but cannot access the redhat scl repo. So I installed php72 from remi.
        In the part "Using Third Party PHP Repositories" is written "Using any third-party repository that provides PHP.". So I did that, installed all needed packages, but now: How to install the web-frontend?
        You wrote to use packages without -scl at the end. Where are those packages? I searching through the documentation now for a while, but running in circles.
        The only one without scl is zabbix-web, but there no such for pgsql or mysql.

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          If you can't use the SCL packages, you can only use the zabbix-web package for the front end. It is necessary to prepare the settings and configuration files provided by other packages by yourself.
          If you can't, use the SCL packages or consider moving to RHEL 8.

          Comment

          • mkihr
            Junior Member
            • Aug 2020
            • 4

            #6
            Ok. That's again a very unclear answer. It would be nice to provide the informations what files are needed here. In between I figured that out.
            It's possible to do it in the following way:
            You can install the packages mentioned in the upgrade notes for the Web Frontend.
            Two of them need a special command to install:
            Code:
            rpm -Uvh --nodeps $(repoquery --location zabbix-web-deps-scl)
            Code:
            rpm -Uvh --nodeps $(repoquery --location zabbix-web-pgsql-scl)
            You should install all php and all necessary modules as mentioned in the installation manual.
            In case you use remi php you have to copy the config /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf to the remi dir /etc/opt/remi/php72/php-fpm.d/zabbix.conf and adapt the path settings in that file also to your remi dirs.
            Delete the www.conf in /etc/opt/remi/php72/php-fpm.d/
            Fix the socket path in /etc/httpd/conf.d/zabbix.conf
            After that zabbix server can be started and it works.

            Comment

            • tim.mooney
              Senior Member
              • Dec 2012
              • 1427

              #7
              Originally posted by mkihr
              It's possible to do it in the following way:
              You can install the packages mentioned in the upgrade notes for the Web Frontend.
              Two of them need a special command to install:
              Code:
              rpm -Uvh --nodeps $(repoquery --location zabbix-web-deps-scl)
              Code:
              rpm -Uvh --nodeps $(repoquery --location zabbix-web-pgsql-scl)
              I'm not trying to be harsh, but that's a terrible idea and I hope anyone else that finds your post does not follow your example. Using '--nodeps' with rpm directly is a trap for the inexperienced. It's eventually going to cause you problems.

              Atsushi 's answer was the correct one. If you had followed up and asked something like "Hey, I installed just zabbix-web but now I don't know what I need to configure manually", you probably would have gotten an answer from someone (eventually) about which files you need to create or tailor for your non-standard PHP setup.

              Anyway, I'm glad you're happy with your system's state, but I hope others don't follow your example.

              Comment

              • Atsushi
                Senior Member
                • Aug 2013
                • 2028

                #8
                Hint:
                Code:
                # yum install yum-utils wget
                # 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-fpm
                # yum install https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
                # yum-config-manager --enable zabbix-frontend
                # yum install zabbix-agent zabbix-server-mysql zabbix-web
                # mkdir temp
                # cd temp/
                # wget https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-apache-conf-5.0.2-1.el8.noarch.rpm
                # wget https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-web-5.0.2-1.el8.noarch.rpm
                # rpm2cpio zabbix-apache-conf-5.0.2-1.el8.noarch.rpm | cpio -id
                # rpm2cpio zabbix-web-5.0.2-1.el8.noarch.rpm | cpio -id
                # cp etc/httpd/conf.d/zabbix.conf /etc/httpd/conf.d/
                # cp etc/php-fpm.d/zabbix.conf /etc/php-fpm.d/
                # vi /etc/php-fpm.d/zabbix.conf

                Code:
                listen.acl_users = apache,nginx
                to
                Code:
                listen.acl_users = apache
                Code:
                ; php_value[date.timezone] = Europe/Riga
                to
                Code:
                php_value[date.timezone] = Your-Timezone

                Comment

                • tim.mooney
                  Senior Member
                  • Dec 2012
                  • 1427

                  #9
                  For anyone that finds this thread for RHEL 7 / CentOS 7 / Oracle Linux 7 / etc and needs to use PHP 7.x that doesn't come from SCL, please please use Atsushi 's excellent step-by-step procedure from post #8. Don't use the rpm commands from post #6.

                  If it's not clear what's going on between the "mkdir temp" and rpm2cpio/cp commands a few steps later, what Atsushi is doing is
                  1. downloading the 'zabbix-apache-conf' and 'zabbix-web' packages for RHEL 8 (yes, RHEL 8). They're not getting installed, just downloaded
                  2. the rpm2cpio of each package, piped into the actual cpio command, extracts copies of every file contained in the packages. Again, it does not install them. It's kind of like un-tarring something, but this is the idiom that you use to pull files out of an RPM package without installing it.
                  3. once all the files have been extracted, you copy the two example/template configuration files that are needed for Apache (etc/httpd/conf.d/zabbix.conf) and PHP-FPM (etc/php-fpm.d/zabbix.conf) into the system paths where they will be read by Apache httpd and Remi's PHP-FPM.

                  This is a much, much better way to get copies of the httpd zabbix.conf and php-fpm zabbix.conf and integrate them into a non-standard PHP config on RHEL 7.x. The Zabbix developers could basically add this to the documentation as an example of how to use Remi's PHP on RHEL 7.x.

                  Comment

                  • mkihr
                    Junior Member
                    • Aug 2020
                    • 4

                    #10
                    Thanks to tim.mooney and Atsushi. For sure this is the better way.
                    But it was really hard to find some hints how to install the frontend with different php source.
                    I fixed my system now also in the described way.
                    This should be part of the install documentation.

                    Comment

                    • azay19
                      Junior Member
                      • Feb 2021
                      • 2

                      #11
                      Hi!

                      I had the same problem with frontend installing zabbix 5.0 in RHEL7. After tons of troubleshoot this help to find solution and I create repository then install required rh-php72 packages:


                      Try this - mirror.yandex.ru/centos/7.9.2009/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm

                      Comment

                      • Oscar Garcia
                        Junior Member
                        • Oct 2015
                        • 6

                        #12
                        Worse than installing packages without dependencies is installing packages from untrusted repositories.

                        To get rh_php72 you must to install this package:

                        Code:
                        yum install -y oracle-softwarecollection-release-el7
                        You will then have all the missing packages available.

                        The guys at zabbix should update their installation procedure.

                        Comment

                        • tim.mooney
                          Senior Member
                          • Dec 2012
                          • 1427

                          #13
                          Originally posted by Oscar Garcia
                          Worse than installing packages without dependencies is installing packages from untrusted repositories.
                          Agreed.

                          Originally posted by Oscar Garcia
                          The guys at zabbix should update their installation procedure.
                          They don't support RHEL 7 for the frontend or the server with Zabbix 5.2 or later, so only the 5.0 LTS is impacted by SCL packages. The Zabbix developers are "washing their hands" of SCL: https://blog.zabbix.com/staying-up-t...ackages/12806/

                          Comment

                          Working...