问题
I try like this tutorial: https://computingforgeeks.com/how-to-install-php-7-3-on-centos-7-fedora/
in my way is: [root@intranet ~]# sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm ..... Complete!
Next: [root@intranet ~]# sudo yum -y install epel-release yum-utils ... Complete! [root@intranet ~]# sudo yum-config-manager -- disable remi-php54
Loaded plugins: fastestmirror, langpacks
=================================================================== repo: remi-php54 ===================================================================
[remi-php54]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7
baseurl =
cache = 0
cachedir = /var/cache/yum/x86_64/7/remi-php54
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = False
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7/remi-php54/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7/remi-php54/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
hdrdir = /var/cache/yum/x86_64/7/remi-php54/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist = http://cdn.remirepo.net/enterprise/7/php54/mirror
mirrorlist_expire = 86400
name = Remi's PHP 5.4 RPM repository for Enterprise Linux 7 - x86_64
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7/remi-php54
pkgdir = /var/cache/yum/x86_64/7/remi-php54/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = remi-php54
ui_repoid_vars = releasever,
basearch
username =
[root@intranet ~]# sudo yum-config-manager -- enable remi-php73
Loaded plugins: fastestmirror, langpacks
=================================================================== repo: remi-php73 ===================================================================
[remi-php73]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7
baseurl =
cache = 0
cachedir = /var/cache/yum/x86_64/7/remi-php73
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = False
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7/remi-php73/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7/remi-php73/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
hdrdir = /var/cache/yum/x86_64/7/remi-php73/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist = http://cdn.remirepo.net/enterprise/7/php73/mirror
mirrorlist_expire = 86400
name = Remi's PHP 7.3 RPM repository for Enterprise Linux 7 - x86_64
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7/remi-php73
pkgdir = /var/cache/yum/x86_64/7/remi-php73/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = remi-php73
ui_repoid_vars = releasever,
basearch
username =
In next step I have some errors:
[root@intranet ~]# sudo yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bc math php-json
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.icm.edu.pl
* epel: ftp.icm.edu.pl
* extras: ftp.icm.edu.pl
* remi-safe: mirror.reconn.ru
* updates: ftp.icm.edu.pl
Package 1:php-pear-1.9.4-21.el7.noarch already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-42.el7 will be updated
---> Package php.x86_64 0:5.4.16-46.1.el7_7 will be an update
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.2)(64bit) for package: php-5.4.16-46.1.el7_7.x86_64
---> Package php-bcmath.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-bcmath.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-cli.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-cli.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-common.x86_64 0:5.4.16-42.el7 will be updated
--> Processing Dependency: php-common(x86-64) = 5.4.16-42.el7 for package: php-pdo-5.4.16-42.el7.x86_64
--> Processing Dependency: php-common(x86-64) = 5.4.16-42.el7 for package: php-ldap-5.4.16-42.el7.x86_64
--> Processing Dependency: php-common(x86-64) = 5.4.16-42.el7 for package: php-process-5.4.16-42.el7.x86_64
---> Package php-common.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-devel.x86_64 0:5.4.16-46.1.el7_7 will be installed
--> Processing Dependency: pcre-devel(x86-64) for package: php-devel-5.4.16-46.1.el7_7.x86_64
--> Processing Dependency: automake for package: php-devel-5.4.16-46.1.el7_7.x86_64
--> Processing Dependency: autoconf for package: php-devel-5.4.16-46.1.el7_7.x86_64
---> Package php-fpm.x86_64 0:5.4.16-46.1.el7_7 will be installed
---> Package php-gd.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-gd.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-mbstring.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-mbstring.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-mcrypt.x86_64 0:5.4.16-7.el7 will be updated
---> Package php-mcrypt.x86_64 0:5.4.16-9.el7 will be an update
---> Package php-mysqlnd.x86_64 0:5.4.16-46.1.el7_7 will be installed
---> Package php-xml.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-xml.x86_64 0:5.4.16-46.1.el7_7 will be an update
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
---> Package openssl-libs.x86_64 1:1.0.1e-60.el7_3.1 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-60.el7_3.1 for package: 1:openssl-1.0.1e-60.el7_3.1.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-19.el7 will be an update
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
--> Processing Dependency: pcre(x86-64) = 8.32-17.el7 for package: pcre-devel-8.32-17.el7.x86_64
---> Package php-ldap.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-ldap.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-pdo.x86_64 0:5.4.16-42.el7 will be updated
--> Processing Dependency: php-pdo(x86-64) = 5.4.16-42.el7 for package: php-mysql-5.4.16-42.el7.x86_64
---> Package php-pdo.x86_64 0:5.4.16-46.1.el7_7 will be an update
---> Package php-process.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-process.x86_64 0:5.4.16-46.1.el7_7 will be an update
--> Running transaction check
---> Package m4.x86_64 0:1.4.16-10.el7 will be installed
---> Package openssl.x86_64 1:1.0.1e-60.el7_3.1 will be updated
---> Package openssl.x86_64 1:1.0.2k-19.el7 will be an update
---> Package pcre.x86_64 0:8.32-15.el7_2.1 will be updated
---> Package pcre.x86_64 0:8.32-17.el7 will be an update
---> Package php-mysql.x86_64 0:5.4.16-42.el7 will be updated
---> Package php-mysql.x86_64 0:5.4.16-46.1.el7_7 will be an update
--> Processing Conflict: php-mysql-5.4.16-46.1.el7_7.x86_64 conflicts php-mysqlnd
--> Finished Dependency Resolution
Error: php-mysql conflicts with php-mysqlnd-5.4.16-46.1.el7_7.x86_64
You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
ipa-client-4.4.0-14.el7.centos.7.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.0-14.el7.centos.7.x86_64
ipa-client-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.0-14.el7.centos.7.noarch
ipa-common-4.4.0-14.el7.centos.7.noarch has installed conflicts freeipa-common: ipa-common-4.4.0-14.el7.centos.7.noarch
**[root@intranet ~]# php -v
PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@intranet ~]# cat /proc/version
Linux version 3.10.0-514.16.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Apr 12 15:04:24 UTC 2017**
回答1:
mysql extension doesn't exists anymore in PHP 7.
If you really need it, you cannot update.
If mysqli or pdo_mysql are enough, you have to switch first to the php-mysqlnd package, before trying to upgrade to a newer version.
yum remove php-mysql
yum install php-mysqlnd
You can do the same using yum shell to avoid dependency removal
yum shell
remove php-mysql
install php-mysqlnd
run
After the replacement, you will be able to update to a newer version.
To be tested: perhaps a simple yum update
(instead of the long yum install
command) will have work.
As explained by the wizard
来源:https://stackoverflow.com/questions/59892605/how-to-install-php-7-3-on-linux-version-3-10-0-kbuilder-dev-centos-org-red-hat