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, 一下就找到解决办法了。


下载安装    compat-libgmp-4.3.1-1.sl7.x86_64.rpm

继续安装又碰到问题:

Error: php70w-common conflicts with php-common-5.4.16-43.el7_4.1.x86_64
Error: 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




猜你喜欢

转载自blog.csdn.net/langeldep/article/details/79677109
今日推荐