Bug #11057 Updated: Premature end of script headers: c:/php/php.exe
| From: | baret at email dot cz | Date: | Sun, 24 Jun 2001 21:16:06 +0000 |
| Subject: | Bug #11057 Updated: Premature end of script headers: c:/php/php.exe | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57876@lists.php.net to get a copy of this message | ||
ID: 11057
User Update by: baret@email.cz
Status: Closed
Bug Type: ODBC related
Operating system: Windows 98 SE
PHP Version: 4.0.4
Description: Premature end of script headers: c:/php/php.exe
Im sorry. It means, that i see windows error, that there is an error in php.exe. Web server is still
working, but in the log file is written aboud premature ending of ....
No HTML page is shown.
Previous Comments:
---------------------------------------------------------------------------
[2001-06-21 11:23:49] kalowsky@php.net
no user feedback. please reopen the bug if you're still having trouble.
---------------------------------------------------------------------------
[2001-06-01 13:49:08] kalowsky@php.net
when you say it crashes what exactly does that mean? do you still see the web server working and
that message came up? or did you get a nice core dump to show up with that statement on the screen
popup?
---------------------------------------------------------------------------
[2001-05-26 03:55:18] baret@email.cz
OK, here is the part of the script. Btw. i found, that this appears only if in query is agregate
function count(*) (there are two types of query, one works good, other not)
Im using MySQL 3.23.27-beta with MyODBC driver. There is table tab01 with information about clients.
Script:
<html>
<head>
<title>Welcome</title>
<?
function connect()
{
@$con = ODBC_connect("sample-MySQL","","");
if(!$con)
echo "not connected";
return $con;
}
function close ()
{
global $conn;
ODBC_close($conn);
}
function Query ($query)
{
global $conn;
return ODBC_exec($conn, $query);
}
function Fetch_row ()
{
global $rslt;
return ODBC_Fetch_Row($rslt);
}
function Result($field)
{
global $rslt;
return ODBC_Result($rslt, $field);
}
if ($sent)
{
$conn = connect();
if ($conn)
{
$query = "select count(*) cnt from tab01 where
login='".strtolower($login)."'";
//problematic
// $query = "select * from tab01 where
login='".strtolower($login)."'";
//works good
$rslt = query($query);
while(Fetch_row())
$logged = Result("cnt");
if ($logged)
echo $login;
else
echo "not logged";
close();
}
}
?>
</head>
<body>
<form action="default.php">
<center>
<table>
<tr><td>Login: </td>
<td><input value="<?echo $login?>" type="text"
name="login"></td></tr>
<tr><td colspan="2"><center><input type="submit"
value="Submit"></center></td></tr>
</table></center>
<input type="hidden" name="sent" value="true">
</form>
</body>
</html>
---------------------------------------------------------------------------
[2001-05-25 10:03:06] kalowsky@php.net
this really doesn't sound like a PHP problem to me. you said it yourself when "using
normal ODBC_functions everything is alright" (grammer corrected).
regardless of that, if you're still convinced this is a PHP ODBC error, give me a SIMPLE sample
script that i can use to reproduce this (about 10 lines or so), and what database you're using.
---------------------------------------------------------------------------
[2001-05-23 12:41:12] baret@email.cz
I probably recognized the problem, my scripts generates sql queries like this (non-problematic
version):
$query = "select count(*) cnt from tab01, tab11 where login='"
.$login.
"' and tab01.client_id = tab11.client_id and
passwd=password('".$psswd."')";
I changed, so it should not be case sensitive for "login".
$query = "select count(*) cnt from tab01, tab11 where login='"
.strtolower($login).
"' and tab01.client_id = tab11.client_id and
passwd=password('".$psswd."')";
but this didnt work, i tried also to convert to lowercase before using the converted string and that
was also wrong.
$login = strtolower($login);
and then i used the first query.
So when I dont use converted strings, my functions works good, but when I use them, there is a
problem described above.
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=11057