无法安装php 5.6 mssql - Centos 7

时间:2015-10-02 20:01:39

标签: php sql-server linux centos yum

我正在尝试将在Windows Web服务器上运行的应用程序移动到在Centos 7上运行的Linux Web服务。 它是基于调用Microsoft SQL程序的应用程序,我已经使用了sqlsrv驱动程序。但是现在当我将它移动到新服务器时显然它不起作用因为sqarv驱动程序它不支持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

你有什么建议吗?

谢谢

2 个答案:

答案 0 :(得分:5)

根据输出,PHP是从未启用的“remi-php56”安装的(默认情况下)。启用它的好主意,以避免此类问题。

yum-config-manager --enable remi-php56

然后

yum install php-mssql

混合各种第三方存储库的可怕想法。因此@machavity建议从webtatic中排除php包是正确的。

答案 1 :(得分:3)

你有两个竞争套餐。 php.remi vs php56.webtatic

看起来已经安装了remi。所以你需要做的是找到你的webtatic repo文件(可能类似于/etc/yum.repos.d/webtatic.repo)并在[webtatic] repo下面添加这一行

exclude=php56*

这应该可以防止webtatic repo为您提供PHP文件。然后你应该能够做到

yum install php-mssql

将从remi中获取并使用已安装的内容