简体   繁体   中英

Needing sqlsrv driver for PHP on Mac

I am running both, MAMP and Zend Server CE. I just installed the Zend Server because I read here: http://www.jesusomar.com/2011/07/22/mamp-php-and-mssql that it supports SQL Server out of the box. I did have to enable the extension and restart PHP of course.

I have been looking into compiling the necessary driver for MAMP. I hit a roadblock here (directions I have for this: http://www.tumblr.com/tagged/mssql+mamp+php+mac+osx ) where the compile fails for PHP 5.3.5 and 5.3.6. You can see that issue here: https://stackoverflow.com/questions/9675906/compile-error-for-php-mssql . I have not tried other versions yet.

Anyway, no matter what, I get an error:

could not find driver

Here is the offending line in my code:

new PDO( "sqlsrv:server=".$myServer.";Database=FormScript");

You can see I am using the sqlsrv driver. I took another look at MAMP and Zend and realized that neither of them contain the driver. In my Zend instance, I do have MSSQL Support enabled. I checked in phpinfo() . I thought perhaps I could simply change my driver then:

new PDO( "mssql:server=".$myServer.";Database=FormScript");

I still get the same error:

could not find driver

I find this a bit odd. Anyway, any ideas on what I'm missing?

我通过使用Zend Server CE并启用了驱动程序来解决此问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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