更新
降级至PHP 5.5.38 - 仍无效。
_
我正在尝试连接到我网络上的远程mssql数据库。
我尝试过这段代码:
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = '192.168.2.254\HQ';
// Connect to MSSQL
$link = mssql_connect($server, 'username', 'password');
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}
?>
在运行中,我收到以下错误:
[10-Mar-2017 16:35:51 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to undefined function mssql_connect() in /Applications/MAMP/htdocs/Inventory_Management/public_html/connectionTest.php:13
Stack trace:
#0 {main}
thrown in /Applications/MAMP/htdocs/Inventory_Management/public_html/connectionTest.php on line 13
经过一番研究,我发现这个视频说我应该下载一些.dll文件并重启Apache。 https://www.youtube.com/watch?v=-UoXk8qJ82Y
但是,我在Mac上使用MAMP在本地运行。这里有什么想法吗?
其他信息:
PHP Version 7.1.1
System Darwin Andy-iMac.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
Build Date Jan 23 2017 14:35:48
Configure Command './configure' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-zlib-dir=/Applications/MAMP/Library' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php7.1.1' '--exec-prefix=/Applications/MAMP/bin/php/php7.1.1' '--sysconfdir=/Applications/MAMP/bin/php/php7.1.1/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php7.1.1/conf' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/Applications/MAMP/Library' '--with-ldap' '--with-mysqli=mysqlnd' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--with-imap-ssl=/Applications/MAMP/Library' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl=/Applications/MAMP/Library' '--enable-zip' '--with-iconv=/Applications/MAMP/Library' '--enable-opcache' '--enable-intl' '--with-tidy=shared' '--with-icu-dir=/Applications/MAMP/Library' '--enable-wddx' '--with-libexpat-dir=/Applications/MAMP/Library' '--with-readline' '--with-mhash' 'YACC=/Applications/MAMP/Library/bin/bison'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /Applications/MAMP/bin/php/php7.1.1/conf
Loaded Configuration File /Applications/MAMP/bin/php/php7.1.1/conf/php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20160303
PHP Extension 20160303
Zend Extension 320160303
Zend Extension Build API320160303,NTS
PHP Extension Build API20160303,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling enabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*