CentOS7下升級PHP : Requires: libgmp.so.3()(64bit)
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum list "php*"
yum install php71w
CentOS7下升級PHP碰到的問題:
Resolving Dependencies
--> Running transaction check
---> Package php71w-common.x86_64 0:7.1.14-1.w6 will be installed
--> Processing Dependency: libgmp.so.3()(64bit) for package: php71w-common-7.1.14-1.w6.x86_64
--> Processing Conflict: php71w-common-7.1.14-1.w6.x86_64 conflicts php-common < 7.1
--> Finished Dependency Resolution
Error: php71w-common conflicts with php-common-5.4.16-43.el7_4.1.x86_64
Error: Package: php71w-common-7.1.14-1.w6.x86_64 (webtatic)
Requires: libgmp.so.3()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
這個問題百度裡找不到解決辦法, 原始碼編譯 gmp-4.3.1-12.el6.i686.rpm 生成了 libgmp.so.3 庫也不行。
最後翻牆上了google, 一下就找到解決辦法了。
繼續安裝又碰到問題:
Error: php70w-common conflicts with php-common-5.4.16-43.el7_4.1.x86_64Error: Package: php70w-7.0.27-1.w6.x86_64 (webtatic)
Requires: httpd-mmn = 20051115
Installed: httpd-2.4.6-67.el7.centos.6.x86_64 (@updates)
httpd-mmn = 20120211
httpd-mmn = 20120211x8664
httpd-mmn = 20120211-x86-64
Available: httpd-2.4.6-67.el7.centos.x86_64 (base)
httpd-mmn = 20120211x8664
httpd-mmn = 20120211-x86-64
httpd-mmn = 20120211
Available: httpd-2.4.6-67.el7.centos.2.x86_64 (updates)
httpd-mmn = 20120211x8664
httpd-mmn = 20120211-x86-64
httpd-mmn = 20120211
Available: httpd-2.4.6-67.el7.centos.5.x86_64 (updates)
httpd-mmn = 20120211x8664
httpd-mmn = 20120211-x86-64
httpd-mmn = 20120211
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
解決方案 清理 yum clean all
以為下來就可以愉快的玩耍了,然而 php 的 mysql_connect 竟然用不成,google了一下, 是PHP的MySQL擴充套件被從php中移除了。
解決辦法有兩個, 一個是從原始碼編譯安裝PHP,這個太費事了,要編譯半天。
另外就是單獨安裝php擴充套件。
git clone https://github.com/php/pecl-database-mysql.git
或者下面地址下載 :
http://git.php.net/?p=pecl/database/mysql.git;a=summary
yum install php70w-devel
找到phpize的路徑 : /usr/bin/phpize 執行如下命令
cd ./pecl-database-mysql
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config --with-mysql=mysqlnd
make & make install
重啟php-fpm
/bin/systemctl restart php-fpm.service