Click to See Complete Forum and Search --> : Microsoft SQL Server 2005 Express vs. PHP


gosztola.laszlo
12-31-2005, 08:48 AM
Hi all,

I installed on my machine Apache2, PHP 5, and Microsoft SQL Server 2005 EXPRESS Edition. The op.system is Win2000.
The problem, I can't connect to the SQL server via PHP. The PHP works, the sql server works(can accept connection with MSDE Query), and uncommented the line in php.ini about mssql extension. I tried with PHP 4.4.1 also, but still not working.
After that I installed the SQL Server 2005 (not the Express version, but the 180 days trial version) on another machine, allowed remote connection, and I can connect to it via php without any problems.

What could be the reason why I can't connect to the SQL Server Express?

Please help me!

Thanks for all!

Ps. : Happy New Year!

Dreammaster
09-03-2007, 07:47 PM
Greetings.

I have the same problem...backwards.

I have a Windows 2003 server with apache 2.0 and php 5.1..and on another server I have SQL Server, the full version.

When i run my script, php says that is unable to connect to server.

I am searching the web looking for and answer, but I found that other people use IIS instead of apache.

Could you tell me how do you set the installations?

Thanks in advance.

pete_bisby
10-01-2007, 04:08 PM
Try the following:

$dbConn = mssql_connect("localhost,1433", "database", "password");

This is using SQL Server Express on a Windows XP Pro through Apache. Don't ask me why I put the port number there - I just did !

Also, you must make sure that the TCP/IP protocols are enabled for port 1433 within the SQL Server Configuration Manager, which is the default port for SQL Server.