skip to Main Content

CentOS 7.6

I’ve ran through this same process on 5.x versions and 7.2 without issue, but some pear/pecl steps are failing in 7.4 as I’m attempting an upgrade migration from 7.2 right now.

During the provisioning process I am running a timezonedb upgrade from pecl and hitting an error:

[root@d9471f6a1ab2 /]# pear upgrade -c pecl.php.net timezonedb
downloading timezonedb-2019.3.tgz ...
Starting to download timezonedb-2019.3.tgz (413,166 bytes)
....................................................................................done: 413,166 bytes
5 source files, building
running: phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize' failed

So naturally I attempt to install the package it asked for php-devel however it attempts to downgrade some of my existing packages back to php5.4!

yum install php-devel 
...
Error: php73-cli conflicts with php-cli-5.4.16-46.1.el7_7.x86_64
Error: php73-common conflicts with php-common-5.4.16-46.1.el7_7.x86_64

My normal procedure for building out a php runtime includes installing timezonedb pecl package and upgrading it during the provisioning process. This process hasn’t changed much on all previous PHP upgrades, but I’m having some trouble on php7.4

The full package list is included below, but most importantly, I have the following installed:

php74-php-pear

php74-php-devel

Here is the output of yum list installed php*

[root@d9471f6a1ab2 /]# yum list installed php*
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: mirror.fileplanet.com
 * epel: mirror.prgmr.com
 * extras: mirror.hostduplex.com
 * remi-safe: mirrors.mediatemple.net
 * updates: repos.lax.quadranet.com
Installed Packages
php-cli.x86_64                                                                                                                                                                   5.4.16-46.1.el7_7                                                                                                                                                        @updates  
php-common.x86_64                                                                                                                                                                5.4.16-46.1.el7_7                                                                                                                                                        @updates  
php-devel.x86_64                                                                                                                                                                 5.4.16-46.1.el7_7                                                                                                                                                        @updates  
php74-php-bcmath.x86_64                                                                                                                                                          7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-cli.x86_64                                                                                                                                                             7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-common.x86_64                                                                                                                                                          7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-devel.x86_64                                                                                                                                                           7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-fpm.x86_64                                                                                                                                                             7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-gd.x86_64                                                                                                                                                              7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-intl.x86_64                                                                                                                                                            7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-json.x86_64                                                                                                                                                            7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-mbstring.x86_64                                                                                                                                                        7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-opcache.x86_64                                                                                                                                                         7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-pdo.x86_64                                                                                                                                                             7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-pear.noarch                                                                                                                                                            1:1.10.10-4.el7.remi                                                                                                                                                     @remi-safe
php74-php-pecl-geoip.x86_64                                                                                                                                                      1.1.1-11.el7.remi                                                                                                                                                        @remi-safe
php74-php-pecl-igbinary.x86_64                                                                                                                                                   3.1.0-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-pecl-imagick.x86_64                                                                                                                                                    3.4.4-6.el7.remi                                                                                                                                                         @remi-safe
php74-php-pecl-msgpack.x86_64                                                                                                                                                    2.1.0~beta1-1.el7.remi                                                                                                                                                   @remi-safe
php74-php-pecl-redis5.x86_64                                                                                                                                                     5.1.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-pecl-xdebug.x86_64                                                                                                                                                     2.9.0-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-pecl-zip.x86_64                                                                                                                                                        1.15.5-1.el7.remi                                                                                                                                                        @remi-safe
php74-php-pgsql.x86_64                                                                                                                                                           7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-process.x86_64                                                                                                                                                         7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-soap.x86_64                                                                                                                                                            7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-php-xml.x86_64                                                                                                                                                             7.4.1-1.el7.remi                                                                                                                                                         @remi-safe
php74-runtime.x86_64                                                                                                                                                             1.0-1.el7.remi                                                                                                                                                           @remi-safe

Here are my repos:

 * base: mirror.fileplanet.com
 * epel: mirror.prgmr.com
 * extras: mirror.hostduplex.com
 * remi-safe: mirrors.mediatemple.net
 * updates: repos.lax.quadranet.com

2

Answers


  1. Chosen as BEST ANSWER

    EDIT: Updated Solution

    Below is my original solution. However the root issue here is that the remi install for some reason doesn't add anything to the $PATH when yum is used to install the packages.

    It installs things into /opt/remi/php74/ and then its up to you to update your environment variables.

    There is an environment source file left over as a hint on what to do:

    bash-4.2$ cat /opt/remi/php74/enable 
    export PATH=/opt/remi/php74/root/usr/bin:/opt/remi/php74/root/usr/sbin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/opt/remi/php74/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    export MANPATH=/opt/remi/php74/root/usr/share/man:${MANPATH}
    

    In my case I was using docker, so I added to my Dockerfile:

    ENV PATH="/opt/remi/php74/root/usr/bin:/opt/remi/php74/root/usr/sbin${PATH:+:${PATH}}"
    ENV LD_LIBRARY_PATH="/opt/remi/php74/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
    ENV MANPATH="/opt/remi/php74/root/usr/share/man:${MANPATH}"
    

    After that, everything works! So the environment variables are all that was needed. You could use rc.local, /etc/environment, etc to update your environment with them.

    ------

    ORIGINAL SOLUTION:

    Ended up resolving with the following:

    Ensure we have most recent repos:

    yum -y install 
        https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 
        https://repo.ius.io/ius-release-el7.rpm 
        https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm 
        http://mirrors.mediatemple.net/remi/enterprise/remi-release-7.rpm
    

    Then, at minimum, install php74-php-pear and php74-php-devel (I needed to install WAY MORE libs, but I believe these are all that's required)

    Link the pear that remi installed. Not sure why this didn't take place in the first place:

    ln -sf /opt/remi/php74/root/usr/bin/pear /usr/bin/pear
    

    Then I was able to do what I needed to do:

    pear channel-update pecl.php.net 
    pear upgrade -c pecl.php.net timezonedb
    

    Worked successfully.

    • I think the issue was I was running the wrong version of pear and the newly installed version didn't get added to the path. Creating the link to a path dir solved the problem.
    • You could also edit the $PATH but this worked better for my scenario.

  2. 1/ timezonedb extension is NOT useful.

    RPM packages use the system tzdata, which is updated separately.

    2/ you are confused with package names

    • php74-php-* packages are Software Collections designed for parallel
      installation of multiples verson
    • php-* packages are simpler to use as single / default version

    As explained in the FAQ, and if you follow the wizard instructions.

    3/ don’t need to build from sources

    most useful extensions are available as binary packages, see the full list

    4/ symlinks and environment

    If you really prefer the SCL packages (php74-php-*), you can simply set the environment using the command

    module load php74
    

    As SCL are designed for multiples versions, this allow to switch from one version to another

    And if you want to make a collection the default one, you can install the php74-syspaths packages

    But again, simpler to use the php-* packages

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search