简体   繁体   English

尝试在Linux服务器上安装dblib以尝试与SQL Server连接symfony2

[英]install dblib on linux server trying to conenct symfony2 with sql server

I am on linux server but php is not installed in default directory it's in the opt. 我在linux服务器上,但是php没有安装在默认目录中,而是在opt中。

when I runs command php -i it shows me that i have pdo = sqlite and dblib enabled; 当我运行命令php -i时,它表明我已启用pdo = sqlite和dblib;

but when i does phpinfo() it doesn't shows me those pdo_dblib driver. 但是当我执行phpinfo()时,没有显示那些pdo_dblib驱动程序。

I have to conenct symfony2 with sql server through doctrine. 我必须通过原则将symfony2与sql server进行连接。 Even in symfony when I run 甚至在我奔跑的时候

$ php app/console doctrine:query:sql "SELECT * FROM patientInfo"

gives me the correct result but through code gives me error "Could not find driver". 给我正确的结果,但是通过代码给我错误“找不到驱动程序”。

Whe I tryout a script out of symfony I gets the same error "Could not find driver". 当我从symfony中试用脚本时,遇到相同的错误“找不到驱动程序”。

Any help?? 有帮助吗?

It's pretty clear that your webserver (apache?) isn't running same PHP version of your CLI ( C ommand, L ine, I nterface) 这是很清楚的,你的网络服务器(Apache的?)不运行的CLI的相同的PHP版本(C ommand,L INE, 覆盖整个院落)

httpd -V command will show you some informations about httpd -V命令将向您显示一些有关的信息

Take a look to that answer if you need more information about "switching" apache's php version. 如果您需要有关“切换” apache的php版本的更多信息请查看该答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM