Solved

PHP 4.4 with MsSQL on IIS 7

Posted on 2013-06-25
4
1,048 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
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
The viewer will learn how to count occurrences of each item in an array.

685 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