dongxichan8627 2016-05-01 18:01
浏览 98

致命错误:使用wamp php 5.5.12调用未定义函数sqlsrv_connect()

I am trying to connect to a Azure data base. I have read many other stack overflow answers but they did not work for me:

-I have downloaded all the drivers that Azure offers to you. They are in

C:\wamp\bin\php\php5.5.12\ext folder: enter image description here

-I have added to the system variable the path to extensions folder.

-I have set the extension in both php.ini files (inside the apache and php folders).

-Extensions have been set like

extension=php_sqlsrv_5X_ts.dll
extension=php_pdo_sqlsrv_5X_ts.dll and like extension=C:/wamp/bin/php/php5.5.12/ext/php_sqlsrv_5X_ts.dll extension=C:/wamp/bin/php/php5.5.12/ext/php_pdo_5X_ts.dll

Where X means that I have tried 53, 54, 55 and 56.

-I restart all wamp services every single time that I try new changes.

-I have even tried with IISExpress.

-It is still giving me this error and I can't see "sqlsvr" when I use phpinfo().

what more I should do? I have been suffering this for weeks.

  • 写回答

1条回答 默认 最新

  • dongwen6743 2016-05-12 05:29
    关注

    I use this XAMPP with PHP 5.5.34 at https://www.apachefriends.org/download.html to have the test to enable the sqlsrv extension of PHP.

    You can refer my steps:

    1. After install the XAMPP application, run xampp-control.exe, click config=>PHP(php.ini) to check the extension folder.enter image description here
    2. Download the MSSQL driver for PHP in 3.2 version from https://msdn.microsoft.com/en-us/library/cc296170%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396. Uncompress it.
    3. Copy php_pdo_sqlsrv_55_ts.dll and php_sqlsrv_55_ts.dll from the uncompressed driver folder to the PHP extension folder (X:\xampp\php\ext in my scenario).
    4. Add extension=php_pdo_sqlsrv_55_ts.dll and extension=php_sqlsrv_55_ts.dll in PHP.ini file.
    5. Start Apache.

    Meanwhile, you can use phpinfo() to check the setting of Loaded Configuration File and extension_dir to make sure whether you have configured the correct settings in the definite files and the DLL files in the right folder.

    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效