PHP 5.4 and MsSQL on XAMPP

人盡茶涼 提交于 2019-12-12 09:26:52

问题


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:

  1. php_pdo_sqlsrv.dll
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!