Web Hosting Talk







View Full Version : php on windwos2003 problem


delda
03-05-2008, 01:57 PM
O people of expert i have problem regarding a php script
server details as follow
windows server 2003 web edition
IIS6 modified to run php PHP 5.1.3
MySQL Server 5.0 NT
my problem as the following
i have php script runs locally very well on windowsXP WAMP package
the script runs very well with no issue
on the production server the problem happens
the breif of problem are
1 - the script connects to mysql database ( connection file is fine - database is accessible for user no issue with database)
2 - the main page of script is index.php ( user with login data user/password cannot request page directly - also server doesn't page
automaticaly and server returns the follwing url to client's browser http://x***********/m/cp/login.php?accesscheck=%2Fm%2Fcp%2Findex.php
3- i examined the login.php i found the code as follow's
heres the code snippet for brevity i removed html
<?php require_once('../Connections/connect.php'); ?>
<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}

if (isset($_POST['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "failed.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_connect, $connect);

$LoginRS__query=sprintf("SELECT user, pass FROM msn_admin WHERE user='%s' AND pass='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

$LoginRS = mysql_query($LoginRS__query, $connect) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;

//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");

if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}>}
?>
4- if i supply user name and password correctly nothing happens and nor server redirect me to failed.php just
returns the following header value http://x***********/m/cp/login.php?accesscheck=%2Fm%2Fcp%2Findex.php
where should i do to fix the problem
is it an issue with php.ini
or is it an issue with IIS
or is it a of script itself even its running okay on local WAMP boxes

delda
03-06-2008, 11:48 AM
is any sloution for this problem or what should i do to get rid of this dilemma
Thanks in advance for your help

MageUK
03-06-2008, 12:17 PM
How is PHP configured in IIS? As a CGI Module? If so try installing it as an ISAPI module and update to the latest version.

If that doesn't fix your problem post back again.

We can't actually see any error from what you posted though as the links are *ed out.

delda
03-06-2008, 01:08 PM
Hi MageUK
Thanks a milion for you reply it's configured as detailed in photo check out attachment if you please what should i do to fix it and thanks again for you aid

MageUK
03-06-2008, 01:23 PM
Hey Delda

Download the PHP 5.2.5 Setup Package (http://uk3.php.net/get/php-5.2.5-win32-installer.msi/from/a/mirror), run it, install as 'IIS ISAPI module' when prompted by the installer.

Go back to the screen that you were at (Web Service Extensions) and you will see PHP: Hypertext Processer, click it, click Properties from the left, go to the Required Files tab. There's a bug in the installer that sets the path incorrectly, with a ~ in it somewhere, you need to edit this to be the complete path to php5isapi.dll.

Then go back to the screen you were at in your screenshot , and do the same (remove the ~ from the path and make it straight to the DLL).

Attached are screenshots of the working version of both parts.

Hope that helps, if you need any more information feel free to contact me.

Regards,

Rudi

Number09
03-06-2008, 01:24 PM
Try adding an extension for php5wrapper.exe as well as php.exe

delda
03-08-2008, 11:29 AM
Thanks a million Rudi for your aid but its still not working i did as you said in reply i restarted IIS many times and the whole machine but its still not working what else should i consider in mind to let the script work correctly and thanks again for your helpful hint

MageUK
03-08-2008, 11:32 AM
Did you remove the CGI Handler?? Sorry I didn't write to do that before.. It could be overwriting the ISAPI handler.

delda
03-08-2008, 12:02 PM
i beg your pardon what do you mean by "removing the CGI Handler" or where exactly can i remove it thanks