Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP 4.4 with MsSQL on IIS 7

Posted on 2013-06-25
4
Medium Priority
?
1,084 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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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 84

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

618 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