Jump to content

PHP, IIS, MYSQL Problem


Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.