3

I am trying for a couple of days to install php without any luck. The process which usually takes 2 minutes. I have CentOS 7.4.1708 and Apache 2.4.6.
When I install php using yum install php and run the command php -v I get the error php: /lib64/libcrypto.so.10: version OPENSSL_1.0.2 not found (required by php)
When I run command rpm -qi openssl
I get package openssl is not installed
When I run openssl version
I get OpenSSL 1.0.1e-fips 11 Feb 2013
When I run command yum info openssl I get

Available Packages Name : openssl Arch : x86_64 Epoch : 1 Version : 1.0.2k Release : 8.el7 Size : 492 k Repo : base/7/x86_64 Summary : Utilities from the general purpose cryptography library with TLS implementation URL : http://www.openssl.org/ License : OpenSSL Description : The OpenSSL toolkit provides support for secure communications between : machines. OpenSSL includes a certificate management tool and shared : libraries which provide various cryptographic algorithms and : protocols.


yum info php gives
Available Packages Name : php Arch : x86_64 Version : 5.4.16 Release : 43.el7_4.1 Size : 1.4 M Repo : updates/7/x86_64 Summary : PHP scripting language for creating dynamic web sites URL : http://www.php.net/ License : PHP and Zend and BSD Description : PHP is an HTML-embedded scripting language. PHP attempts to make it : easy for developers to write dynamically generated web pages. PHP also : offers built-in database integration for several commercial and : non-commercial database management systems, so writing a : database-enabled webpage with PHP is fairly simple. The most common : use of PHP coding is probably as a replacement for CGI scripts. : : The php package contains the module (often referred to as mod_php) : which adds support for the PHP language to Apache HTTP Server.

The output of yum update openssl is

Loaded plugins: fastestmirror, priorities
base                                                                                        | 3.6 kB  00:00:00     
cm-rhel7-8.0                                                                                | 1.3 kB  00:00:00     
cm-rhel7-8.0-updates                                                                        | 1.3 kB  00:00:00     
epel/x86_64/metalink                                                                        |  29 kB  00:00:00     
extras                                                                                      | 3.4 kB  00:00:00     
updates                                                                                     | 3.4 kB  00:00:00     
webtatic                                                                                    | 3.6 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: centos.mirroring.pulsant.co.uk
 * cm-rhel7-8.0: updates-eu.brightcomputing.com
 * cm-rhel7-8.0-updates: updates-eu.brightcomputing.com
 * epel: www.mirrorservice.org
 * extras: centos.mirroring.pulsant.co.uk
 * updates: centos.mirroring.pulsant.co.uk
 * webtatic: uk.repo.webtatic.com
101 packages excluded due to repository priority protections
No packages marked for update

Here is the output of command ldd /lib64/libcrypto.so.10

linux-vdso.so.1 => (0x00002aaaaaaab000) libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaaaea8000) libz.so.1 => /lib64/libz.so.1 (0x00002aaaab0ac000) libc.so.6 => /lib64/libc.so.6 (0x00002aaaab2c3000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) Output of command openssl version -a

openssl: /lib64/libcrypto.so.10: version `OPENSSL_1.0.2' not found (required by openssl) Here is the output of which openssl /usr/bin/openssl Output of env | grep LD_ is empty.

Okay I am getting forward, with this command yum reinstall openssl openssl-libs That error is gone. Now there is small issue I think. The output of php -v is PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/zip.so' - libzip.so.2: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.4.16 (cli) (built: Mar 7 2018 13:34:47) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

How to get the correct version of php and openssl to get rid of the error?

10
  • 2
    Remove all the third party repositories from the system, and then run yum distro-sync. Apr 25, 2018 at 22:09
  • Hi Michael, removed all repos except the default ones. removed php and reinstalled it after removing the extra repos. Ran the above command but the error is still there.
    – drmaa
    Apr 26, 2018 at 0:22
  • what's the output of ldd /lib64/libcrypto.so.10? Apr 26, 2018 at 8:15
  • also run openssl version -a. Which version of openssl do you have? Apr 26, 2018 at 8:17
  • 1
    Do you have any version locks set on those packages? Try with yum versionlock list if openssl is listed do yum versionlock clear and yum reinstall openssl openssl-libs
    – Daniel
    Apr 26, 2018 at 11:49

2 Answers 2

1

To make it work on Centos 7

yum install -y php php-common

yum reinstall -y openssl openssl-libs

systemctl restart httpd

0

To fix your issues, these command should help:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
yum reinstall openssl openssl-libs -y
yum reinstall libzip -y

yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php54
yum install php php-common php-pecl-zip -y

But clients with openssl version less than 1.1.0 will not allow letsencrypt certificates since yesterday. best practice for centos 7 it's install latest version of openssl from source because it is not exist at any yum repositories as package you can make it with this this script:

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
yum groupinstall -y "Development Tools" "Development Libraries"

cd /usr/src
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1l.tar.gz
tar -zxf openssl-1.1.1l.tar.gz
cd openssl-1.1.1l
./config
make
make install
mv /usr/local/lib64/libcrypto.so.1.1 /usr/local/lib64/libssl.so.1.1 /usr/lib64/
yum install php php-common -y
yum install ca-certificates -y 
systemctl restart httpd

Also i would recommend you install at least 7+version of php instead very deprecated 5.4 You can do that so:

yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable   remi-php74
yum install php php-common -y # and others packages you need
1
  • Let's Encrypt certificate chains with OpenSSL 1.0.2 as shipped by RHEL/CentOS 7 work properly after updating to ca-certificates-2021.2.50-72.el7_9.
    – rsc
    Oct 9, 2021 at 23:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .