安装php 5.6 mssql - Centos 7失败


Failed to install php 5.6 mssql - Centos 7

我试图移动一个应用程序,运行在windows web服务器到linux web服务器上运行在Centos 7。该应用程序是基于调用微软SQL过程,我已经使用sqlsrv驱动程序,当我已经建立了它。但是现在当我把它移到新服务器上时,显然它不工作了,因为sqlsrv驱动程序不支持linux。

问题是,我试图安装PHP -mssql,以便重新编写我的代码来使用这个驱动程序,但我不能使用PHP 5.6.13在Centos 7上安装包。当我尝试安装包时,我得到以下内容,我不知道如何修复它或进一步:

[root@localhost /]# yum install php56w-mssql
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.ines.lug.ro
* epel: fedora.mirrors.telekom.ro
* extras: ftp.ines.lug.ro
* updates: ftp.ines.lug.ro
* webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php56w-mssql.x86_64 0:5.6.13-1.w7 will be installed
--> Processing Dependency: php56w-pdo(x86-64) = 5.6.13-1.w7 for package: php56w-mssql-5.6.13-1.w7.x86_64
--> Processing Dependency: libsybdb.so.5()(64bit) for package: php56w-mssql-5.6.13-1.w7.x86_64
--> Running transaction check
---> Package freetds.x86_64 0:0.91-12.git0a42888.el7 will be installed
--> Processing Dependency: libodbcinst.so.2()(64bit) for package: freetds-0.91-12.git0a42888.el7.x86_64
--> Processing Dependency: libodbc.so.2()(64bit) for package: freetds-0.91-12.git0a42888.el7.x86_64
---> Package php56w-pdo.x86_64 0:5.6.13-1.w7 will be installed
--> Processing Dependency: php56w-common(x86-64) = 5.6.13-1.w7 for package: php56w-pdo-5.6.13-1.w7.x86_64
--> Running transaction check
---> Package php56w-common.x86_64 0:5.6.13-1.w7 will be installed
---> Package unixODBC.x86_64 0:2.3.1-10.el7 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-10.el7.x86_64
--> Running transaction check
---> Package libtool-ltdl.x86_64 0:2.4.2-20.el7 will be installed
Removing php56w-pdo.x86_64 0:5.6.13-1.w7 - u due to obsoletes from installed php-pdo-5.6.13-1.el7.remi.x86_64
Removing php56w-common.x86_64 0:5.6.13-1.w7 - u due to obsoletes from installed php-common-5.6.13-1.el7.remi.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package php56w-common.x86_64 0:5.6.13-1.w7 will be installed
---> Package php56w-pdo.x86_64 0:5.6.13-1.w7 will be installed
--> Processing Dependency: php56w-pdo(x86-64) = 5.6.13-1.w7 for package: php56w-mssql-5.6.13-1.w7.x86_64
--> Finished Dependency Resolution
Error: Package: php56w-mssql-5.6.13-1.w7.x86_64 (webtatic)
       Requires: php56w-pdo(x86-64) = 5.6.13-1.w7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
你有什么建议吗?

谢谢

根据输出,PHP是从未启用(默认)的"remi-php56"安装的。最好启用它,以避免此类问题。

yum-config-manager --enable remi-php56

然后

yum install php-mssql

混合各种第三方存储库是一个糟糕的想法。所以@machavity建议从webtatic中排除php包是正确的。

这里有两个相互竞争的包。php.remi vs php56.webtatic

看起来已经安装了remi。所以你需要做的是找到你的网络repo文件(可能像/etc/yum.repos.d/webtatic.repo),并在[webtatic] repo

下面添加这一行
exclude=php56*

这应该会阻止webatic repo向你提供PHP文件。然后你应该可以执行

yum install php-mssql

它将从remi中拉出并使用已经安装的