adam84 Posted May 4, 2011 Share Posted May 4, 2011 Hello, I know this question has been asked and answered numerous times, but after reading and trying many different approaches over three days, I still have not fixed this problems. I do not understand why my PHP will not connect to the SQL database. In the phpinfo(), I still get "--without-mssql", after I updated my NTWDBLIB.dll file, uncommented the mysql lines in my php.ini. I did not use the msi install, I did everything manual. Other then not connecting to my database everything else seems to be running good. I am really frustrated with this and work like to see if anyone could help me get past this. I am running Windows Server 2008 Standard (V6, SP2) PHP 5.3.6 IIS 7.0.6000.16386 SQL Server 2008 Thanks for any support that will help me Link to comment https://forums.phpfreaks.com/topic/235511-php-iis-mysql-problem/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 4, 2011 Share Posted May 4, 2011 The --without-mssql means that your php was complied without support for mssql and the only things you can do to change that would be to compile php yourself, find a Windows binary that has support for mssql, or use an alternative method - This extension is not available anymore on Windows with PHP 5.3 or later. SQLSRV, an alternative driver for MS SQL is available from Microsoft: » http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. Link to comment https://forums.phpfreaks.com/topic/235511-php-iis-mysql-problem/#findComment-1210417 Share on other sites More sharing options...
adam84 Posted May 4, 2011 Author Share Posted May 4, 2011 Thanks for the reply, So I download the file and moved them into my /ext folder. I added the extensions into the php.ini file. Now when I run the phpinfo() file, the mysql section about half way down shows up, which I hope is the good thing, but the "--without-mssql" still exists, I do not know where that is good or bad. Nonetheless, when I test to see if I can connect, I do not get results. When I run the code below, "Here 01" gets printed, but "Here 02" does not get printed. So clues? $username = "sa"; $password = "myPassword"; $hostname = "(local)\sqlexpress"; $connectionInfo = array( "UID"=>$username, "PWD"=>$password, "Database"=>"TigerpawCRMv11"); echo "Here 1"; $conn = sqlsrv_connect( $hostname, $connectionInfo); echo "Here 2"; if( $conn === false ) { echo "Unable to connect.</br>"; die( print_r( sqlsrv_errors(), true)); }else echo "Connected"; Link to comment https://forums.phpfreaks.com/topic/235511-php-iis-mysql-problem/#findComment-1210449 Share on other sites More sharing options...
PFMaBiSmAd Posted May 4, 2011 Share Posted May 4, 2011 Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON (preferably in your master php.ini) so that all the errors php detects will be reported and displayed? You will save a TON of time. Link to comment https://forums.phpfreaks.com/topic/235511-php-iis-mysql-problem/#findComment-1210452 Share on other sites More sharing options...
adam84 Posted May 4, 2011 Author Share Posted May 4, 2011 I now get the following error when I run the script/ PHP Fatal error: Call to undefined function sqlsrv_connect() Link to comment https://forums.phpfreaks.com/topic/235511-php-iis-mysql-problem/#findComment-1210455 Share on other sites More sharing options...
adam84 Posted May 4, 2011 Author Share Posted May 4, 2011 I got it to work!!! Thanks so much. Link to comment https://forums.phpfreaks.com/topic/235511-php-iis-mysql-problem/#findComment-1210468 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.