php-windows Digest 6 Jul 2003 04:26:29 -0000 Issue 1811

Topics (messages 20692 through 20696):

PHP 5 Beta 1 and IIS
        20692 by: Denis Bourdon
        20696 by: Frank M. Kromann

Sessions help needed!
        20693 by: John Fuller
        20694 by: Luis Ferro

Re: Fatal error with 'DB.php'  - solution
        20695 by: jsWalter

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello there!

Just wanted to know if anyone succeeded in installing the latest PHP 5
Beta 1 under IIS (5 or 6)

I tried :
- ISAPI configuration : the loading of "php4isapi.dll" by W3SVC failed
(I put php4ts.dll and php.ini in %systemdir%)
- CGI/EXE configuration : I get the following (I put
"cgi.force_redirect = 0" in php.ini) :
>> CGI Error
>> The specified CGI application misbehaved by not returning
>> a complete set of HTTP headers. The headers it did return are:

Any idea?
PHP5 "structure" seems to be equivalent to the one of PHP4 (DLLs are
always named php4___) so I'm wondering if there's a bug in IIS support
rather than a new way of installing it compared to PHP4.

Thanks in advance for your suggestions

den



--- End Message ---
--- Begin Message ---
Hi Den,

PHP5 needs libxml2.dll and iconv.dll either in the same folder where
php.exe (CGI version) is or in %systemdir%\system32.

I prefer to keep everything in c:\php5. That makes it possible to run
different versions of PHP on the same system.

- Frank

> Hello there!
> 
> Just wanted to know if anyone succeeded in installing the latest PHP 5
> Beta 1 under IIS (5 or 6)
> 
> I tried :
> - ISAPI configuration : the loading of "php4isapi.dll" by W3SVC failed
> (I put php4ts.dll and php.ini in %systemdir%)
> - CGI/EXE configuration : I get the following (I put
> "cgi.force_redirect = 0" in php.ini) :
> >> CGI Error
> >> The specified CGI application misbehaved by not returning
> >> a complete set of HTTP headers. The headers it did return are:
> 
> Any idea?
> PHP5 "structure" seems to be equivalent to the one of PHP4 (DLLs are
> always named php4___) so I'm wondering if there's a bug in IIS support
> rather than a new way of installing it compared to PHP4.
> 
> Thanks in advance for your suggestions
> 
> den
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 




--- End Message ---
--- Begin Message ---
Hello all, 
    I am new to php in general and am trying to set up a user authentification system 
with mysql.  The registration page works well and sends all of the data to the 
appropriate table in mysql.  However, when I try to get the registered user to log in 
and start a session, the system will not remember the session information past the 
page.  For instance, this page will not work (the one that initially is supposed to 
register the session from the login form):
 
<?
session_start();
$username="chris";
$database="login";
$login = $_POST['login'];
$password = $_POST['password'];
if((!$login) || (!$password)){
 echo "Please enter ALL of the information! <br />";
 include 'login.php';
 exit();
}
mysql_connect(localhost,$username);
@mysql_select_db($database) or die( "Unable to select database");
$sql=mysql_query("SELECT * FROM login WHERE login='$login' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
  // This is where I register the session
  session_register('login');
  $_SESSION['login'] = $login;  
  mysql_close();
include 'success.php';
} else {
 echo "You could not be logged in! Either the username and password do not match or 
you have not validated your membership!<br />
 Please try again!<br />";
 include 'login.php';
}
?>
 
It proceeds to login the user for that page (I know this happens because I have played 
around with it looking at the error checks), but it will not display any variable that 
resembles "$_SESSION['login']".  
The next page sequentially (success.php) looks like this:
 
<?
session_start();
echo 'Successful login for "$_SESSION['login']"';
?>
 
Any and all variations of this page come up blank and white whenever the variable 
$_SESSION['login'] is called to display. It shows no memory of me registering a 
session.  Any variation of quotes verse apostrophes changes nothing, so I figure that 
either I am blatantly screwing up the session code (possible for I have never written 
any sessions before) or my system is not supporting sessions.  I have a php4 
something, windows, apache 1.3.27 for my home network server, and mysql.  Any help on 
this problem would be greatly appreciated.  
Thanks a lot for your time, John



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

--- End Message ---
--- Begin Message --- Security alert:

If you don't check the post vars, someone could add after the password something like

$password = "343'; drop database;";

If someone sent that in the password field... the database would be droped (permissions could avoid part of the problem, but the vulnerability stands)...

As for the session problems...

a) incorrect session configuration in php.ini (specially the path where the session files are created);
b) no permissions of web server to create the stated files;
c) problems with the version of php in use.


There have been some minor but not nice changes in the session handling in the 4.x version, and 4.1.2 had a very bugged session system.

Be specially wary of the order of which the headers of the page are updated and the session updated.

Cheers,
Luis Ferro


John Fuller wrote:


Hello all, I am new to php in general and am trying to set up a user authentification system with mysql. The registration page works well and sends all of the data to the appropriate table in mysql. However, when I try to get the registered user to log in and start a session, the system will not remember the session information past the page. For instance, this page will not work (the one that initially is supposed to register the session from the login form):

<?
session_start();
$username="chris";
$database="login";
$login = $_POST['login'];
$password = $_POST['password'];
if((!$login) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'login.php';
exit();
}
mysql_connect(localhost,$username);
@mysql_select_db($database) or die( "Unable to select database");
$sql=mysql_query("SELECT * FROM login WHERE login='$login' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
// This is where I register the session
session_register('login');
$_SESSION['login'] = $login; mysql_close();
include 'success.php';
} else {
echo "You could not be logged in! Either the username and password do not match or you have not validated your membership!<br />
Please try again!<br />";
include 'login.php';
}
?>


It proceeds to login the user for that page (I know this happens because I have played around with it looking at the error checks), but it will not display any variable that resembles "$_SESSION['login']". The next page sequentially (success.php) looks like this:

<?
session_start();
echo 'Successful login for "$_SESSION['login']"';
?>

Any and all variations of this page come up blank and white whenever the variable $_SESSION['login'] is called to display. It shows no memory of me registering a session. Any variation of quotes verse apostrophes changes nothing, so I figure that either I am blatantly screwing up the session code (possible for I have never written any sessions before) or my system is not supporting sessions. I have a php4 something, windows, apache 1.3.27 for my home network server, and mysql. Any help on this problem would be greatly appreciated. Thanks a lot for your time, John



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!





--- End Message ---
--- Begin Message ---
OK, I solved it.

It seems that I **HAVE TO**, **MUST**, **NO CHOICE** place my php.ini in
C:\WINNT (for NT and 2k) or PHP will not find it. This is a hardcoded path
done at compile time.

So, since no ini file, PHP was running on default values, thus it could not
find DB.php since the default path there was 'C:\php4\pears'

So, I copied my php.ini file to C:\winnt, renamed the added php4 to php4x
(just to hide it to see if this would work), restarted my Apache (since the
docs tell me that the PHP process that runs with Apache reads this file once
at Apache startup) and I ran my script.

It now works.

Just thought I'd share to the next stubborn person finds this solution.

Walter



--- End Message ---

Reply via email to