问题
I'm trying to run mssql
driver for PHP, but something goes wrong.
I managed to get the right drivers for mssql, then added the extensions in php.ini, but PHP is still running "--without-mssql" "--without-pdo-mssql"
.
I'm running PHP 5.4 under Apache 2.2 on Windows XP SP3.
How to start the mssql drivers?
回答1:
I've just had the same problem, for me I needed to use a different version of the driver.
I was using:
extension=php_sqlsrv_53_ts.dll
Which gave me the following error in PHP:
[28-Nov-2013 10:58:47 UTC] PHP Warning: PHP Startup: sqlsrv: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API
The solution:
extension=php_sqlsrv_54_ts.dll
Download from: http://www.microsoft.com/en-us/download/details.aspx?id=20098
回答2:
See this answer: https://stackoverflow.com/a/25199324/1847383. If you use PHP as an Apache module, use the thread safe version.
回答3:
I have found a great tutorial and explanation on this website:
http://bendustries.co/wp/setting-up-xampp-to-work-with-mssql/
All you need to do is download from here : https://www.microsoft.com/en-us/download/details.aspx?id=20098
two files called:
- php_pdo_sqlsrv.dll
- php_pdo_sqlsrv.dll
And place then inside the php\ext
folder.
Then you need to add those two lines under "Dynamic Extensions"
extension=php_sqlsrv.dll
extension=php_pdo_sqlsrv.dll
Save your php.ini file and restart apache, This process worked for me on win7 after I tried several other methods !
来源:https://stackoverflow.com/questions/17542494/php-5-4-and-mssql-on-xampp