简体   繁体   English

wamp php5.3.5 mssql_connect()致命错误

[英]wamp php5.3.5 mssql_connect() Fatal error

我正在使用WampServer版本2.2,php5.4.3,Apeache2.2.22。我无法使用mssql_connect(),“ mssql_connect()致命错误:调用未定义的函数mssql_connect()”我经过了谷歌搜索,但仍未找到解决方案。

It is always better to use PDO which supports ms sqlserver and other databases, you can use the syntax $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass); 最好使用支持ms sqlserver和其他数据库的PDO,可以使用语法$ dbh = new PDO('mysql:host = localhost; dbname = test',$ user,$ pass); or you can refer the documentation https://secure.php.net/manual/en/pdo.connections.php 或者您可以参考文档https://secure.php.net/manual/en/pdo.connections.php

You don't have the MS SQL Drivers installed. 您没有安装MS SQL驱动程序。 You can check this with phpinfo() ; 您可以使用phpinfo()进行检查;

On Linux you need mssql.so or sybase.so With debian its apt-get install php5-sybase 在Linux上,您需要mssql.sosybase.so使用debian的apt-get install php5-sybase

For windows take a look here 对于窗户,请看这里

Drivers need to be configured for PHP to find the function 需要为PHP配置驱动程序以查找功能

mssql_...

You could also look at PDO DB classes as they can connect to any DBS , you need the drivers installed tho. 您还可以查看PDO DB类,因为它们可以连接到任何DBS ,您需要安装驱动程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM