Forum Moderators: open
I have a MSSQL server.. Been working fine for years. Over the last 3 years I'd written a bunch of PHP code to interact with the MSSQL database. The company I worked for shut down, and I got all the servers in lieu of pay, so I have them all set up in my basement now. (I am on a new domain name though using the same computer names, new IP addressing, etc)
The DB connection code used to work just fine on the web server, but it no longer does. so I tried moving the code to the MSSQL server and altering the DB connection lines so it tries to connect to localhost instead, but that fails as well.
I have successfully telnetted to the local IP via port 1433 so I know that it is accepting connections.
The error I get:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost
or
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: sql.domain.com
I have verified that theusername/password I am using to connect is valid in SQL Enterprise Manager.
Here's some info from phpinfo.php:
PHP Version 5.2.9
System Windows NT MOOSE 5.2 build 3790
Build Date Feb 25 2009 15:51:41
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\xampp\php\php.ini
Scan this dir for additional .ini files (none)
additional .ini files parsed (none)
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib, zip
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*
I am at a sincere loss, and have no idea what to try. Any guidance is most appreciated. I do not believe it is a php problem (though I very well could be wrong!) My gut says it's a server config issue.
You'll need to make sure that points to the new domain name and that the domain name resolves to the correct IP address, whether through DNS or your hosts file.