[英]Fatal error: Call to undefined function sqlsrv_connect() using wamp php 5.5.12
I am trying to connect to a Azure data base.我正在尝试连接到 Azure 数据库。 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. - 我已经下载了 Azure 提供给你的所有驱动程序。 They are in
他们在
C:\\wamp\\bin\\php\\php5.5.12\\ext folder:
C:\\wamp\\bin\\php\\php5.5.12\\ext 文件夹:
-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). - 我已经在两个 php.ini 文件中设置了扩展名(在 apache 和 php 文件夹中)。
-Extensions have been set like - 扩展已设置为
extension=php_sqlsrv_5X_ts.dll
扩展名=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.dllextension=php_pdo_sqlsrv_5X_ts.dll 等 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.其中X表示我尝试了 53、54、55 和 56。
-I restart all wamp services every single time that I try new changes. - 每次尝试新更改时,我都会重新启动所有 wamp 服务。
-I have even tried with IISExpress. -我什至尝试过 IISExpress。
-It is still giving me this error and I can't see "sqlsvr" when I use phpinfo()
. - 它仍然给我这个错误,当我使用
phpinfo()
时我看不到“sqlsvr”。
what more I should do?我还应该做什么? I have been suffering this for weeks.
我已经受苦了好几个星期了。
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.我在https://www.apachefriends.org/download.html上将此 XAMPP 与 PHP 5.5.34 一起使用,以进行测试以启用 PHP 的
sqlsrv
扩展。
You can refer my steps:你可以参考我的步骤:
xampp-control.exe
, click config
=> PHP(php.ini)
to check the extension folder.xampp-control.exe
,单击config
=> PHP(php.ini)
检查扩展文件夹。 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).php_pdo_sqlsrv_55_ts.dll
和php_sqlsrv_55_ts.dll
从未压缩的驱动程序文件夹复制到 PHP 扩展文件夹(在我的场景中为X:\\xampp\\php\\ext
)。extension=php_pdo_sqlsrv_55_ts.dll
and extension=php_sqlsrv_55_ts.dll
in PHP.ini
file.PHP.ini
文件中添加extension=php_pdo_sqlsrv_55_ts.dll
和extension=php_sqlsrv_55_ts.dll
。 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.同时,您可以使用
phpinfo()
检查Loaded Configuration File
和extension_dir
的设置,以确保您在确定文件和正确文件夹中的 DLL 文件中配置了正确的设置。
I refer to the practice of Jordi's message in this post: Fatal error: Call to undefined function sqlsrv_connect() in C:\\xampp\\htdocs
我参考了Jordi在这篇帖子里的做法: Fatal error: Call to undefined function sqlsrv_connect() in C:\\xampp\\htdocs
xampp3.2.1 + php 5.5 + sql server 2014 Express, x64. xampp3.2.1 + php 5.5 + sql server 2014 Express,x64。
My situation is, transplant xampp folder to a brand new computer.我的情况是,将xampp文件夹移植到一台全新的电脑上。
Then it can work!!!!!然后就可以工作了!!!!!
I have been searching for a solution to this problem for several days and hope to help more people.我这几天一直在寻找这个问题的解决方案,希望能帮助到更多的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.