致命错误:调用xampp中未定义的函数mssql_connect()或sqlsrv_connect() [英] Fatal error: Call to undefined function mssql_connect() or sqlsrv_connect() in xampp

查看:94
本文介绍了致命错误:调用xampp中未定义的函数mssql_connect()或sqlsrv_connect()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在此处进行了所有更改但是我仍然无法在php 5.6版本上连接SQL Server.

I did all the changes given here but I still not connect SQL server on my php 5.6 version.

我尝试同时使用mssql_connect()sqlsrv_connect().

我改变了

; On windows: extension_dir = "ext"

收件人:

; On windows: extension_dir = "D:\xampp\php\ext"

我也安装了.dll s.但是结果仍然是:

I have installed .dlls too. But result is still:

致命错误:调用未定义函数sqlsrv_connect()

Fatal error: Call to undefined function sqlsrv_connect()

致命错误:调用未定义的函数mssql_connect()

Fatal error: Call to undefined function mssql_connect()

有人可以帮我吗?

推荐答案

mssql_connect()从PHP 7.0开始不再受PHP的支持,在5.3中已弃用.

mssql_connect() is no longer supported by PHP since PHP 7.0 and was depreciated in 5.3.

创建一个phpinfo.php文件:

Create a phpinfo.php file:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

打开页面,在打开的第一页上,从底部开始第三页,检查注册的流是否包含"sqlsrv":

Open the page, and on the first page that's opened, third from the bottom, check if the registered streams contains 'sqlsrv':

Registered PHP Streams  php, file, glob, data, http, ftp, zip, compress.zlib, phar, sqlsrv

如果没有,则必须启用该模块. 尝试取消注释此更改的代码: 发件人:

If it doesn't then you have to enable the module. Try uncomment this code that you changed: From:

; On windows: extension_dir = "D:\xampp\php\ext" "

收件人:

On windows: extension_dir = "D:\xampp\php\ext"

让我们知道结果.

这篇关于致命错误:调用xampp中未定义的函数mssql_connect()或sqlsrv_connect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆