doutang7707 2017-03-10 15:49
浏览 48

MSSQL PHP远程连接

UPDATE:

Downgraded to PHP 5.5.38 - Still not working.

_

I'm trying to connect to a remote mssql database that is on my network.

I have tried this bit of code:

<?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');
}
?>

On run I get the following error:

    [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

After some research, I found this video stating I should download a few .dll files and restart Apache. https://www.youtube.com/watch?v=-UoXk8qJ82Y

However, I'm running locally using MAMP on a mac. Any ideas here?

Additional Info:

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.*
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度