Solved

PHP 4.4 with MsSQL on IIS 7

Posted on 2013-06-25
4
1,057 Views
Last Modified: 2013-07-01
I have a new IIS 7 installation and need to run PHP 4.x with the older MsSQL extension temporarily. The extension must support the mssql_connect function.
How can I accomplish this?
0
Comment
Question by:OAC Technology
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39276559
If it's your server or computer, just set up a site, download a copy of PHP and install it.  Note that 'mssql' works up thru PHP 5.2.  You don't 'have' to go back to PHP 4 unless something else in your code requires it.  PHP 4.4.9, the last PHP 4 version, is available here: http://museum.php.net/php4/php-4.4.9-Win32.zip
0
 
LVL 9

Expert Comment

by:tanujchandna
ID: 39276934
Hi,

If mssql_connect is not working for you then configure SQLSrv in PHP using the following url:

http://www.microsoft.com/en-us/download/details.aspx?id=20098

Open read me (available under this download url) to see how to configure it in php.ini file.

After configuring the extension in php.ini use the following connection string to connect with MSSQL

<?php
$serverName = "xx.xx.xx.xx"; //serverName\instanceName, portNumber (default is 1433)
$connectionInfo = array( "Database"=>"aadharinstitute", "UID"=>"aadharinstitute", "PWD"=>"java.net");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>
0
 
LVL 2

Author Comment

by:OAC Technology
ID: 39278930
I can't change it to sqlsrv_connect because that would require a full rewrite of the entire codebase. There has to be an easier way to do this.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39278968
PHP 5.2.17 will use the 'mssql' driver and it's still available too.  It's not supported starting with PHP 5.3 on Windows.  And no, there does not have to be an easier way to do this.  And if you keep this app on the web on Windows servers, you will eventually have to rewrite your code.  

The reason for the change is that the old 'mssql' driver has not be supported or updated for many years.  Microsoft wrote their own driver as much to keep people from switching to MySQL as any other reason.  You may notice that 'mssql' is still supported on Linux.  Don't be fooled, it's not really the same driver.  It has the same apparent syntax but 'under the hood', it's different and pretty limited.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question