php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20694 html not properly going to browser
Submitted: 2002-11-28 04:14 UTC Modified: 2003-01-02 20:32 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: briantmeyer at earthlink dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.0RC2 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2002-11-28 04:14 UTC] briantmeyer at earthlink dot com
Just installed 4.3.0RC2 zip binary on windows 2000 server 
and iis 5.0 to check it out on my server.
normally use 4.2.3 and seem to be able to swap out installs 
as needed by putting files in and out of my php directory.

4.3.0RC2 seems to not like pages that work fine in 4.2.3. 
Some Pages using the new release display as raw text 
instead of html in some cases. When i look at source in a 
browser the beginning lines are missing although they are 
included. It seems no php is missed as all work i assign is 
completed as expected, just the html sent after the fact 
has missing lines at the top. I would expect it to die as 
it moves through the script, instead it is as if all works 
correctly but at the last moment only sends partial ending 
text to the browser.


As an example, changing the order only of an index page has 
the following results. (The includes here are very simple 
containing mainly html) 

The following works fine but the first line that shows up 
is the 4th with title tags, not <HTML><HEAD>:------>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//
EN">
<html><head>
<?php require ("includes/globals.php"); ?>
<title><?php echo $title ?></title>
<?php require ("includes/classes.php"); ?>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC=
"includes/submitonce.js"></SCRIPT> 
	</head>
<?php
require ("styles/header.php")
?>
<?php
	include ("includes/ftpsendbuttons.php");
?>
HTML content here

While this is much worse and the first tag that shows up is 
<META> tags that are in classes.php followed by the <
SCRIPT> tag. It skips the title tag.------->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//
EN">
<?php require ("includes/globals.php"); ?>
<html><head>
<?php require ("includes/classes.php"); ?>
<title><?php echo $title ?></title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC=
"includes/submitonce.js"></SCRIPT> 
	</head>
<?php
require ("styles/header.php")
?>
<?php
	include ("includes/ftpsendbuttons.php");
?>
		HTML content here


Changing php.ini does not help, adjusted it for over 2 
hours to see if a setting affected this. (expose_php and 
various error directives, using the two provided ini files, 
and many random changes) Of course all extensions were 
disabled. Different pages are affected differently.

My gut feeling is that php parses my script and assembles a 
completed html page. At this point something happens that 
deletes the top x lines (it never does half a line) and 
sends the rest to the browser. If enough header shows up i 
get a web page, usually with text at the top of exposed 
javascripts, sometimes i get text.

testing with pages that are simple text or simple html had 
the entire page show up just fine. The requires i used seem 
to be part of the issue as above. I tried looking at the 
index page from phpmyadmin but it would not even load due 
to not being able to find include files.

Switching back to php 4.2.3 fixes all above problems and 
pages again display the doctype and the html head tags. I 
hope someone can make sense of this, or that it is in fact 
a bogus/support issue.

I probably would not have submitted it, except that it is 
the preview release and that my other version works 
splendidly.

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-28 07:30 UTC] iliaa@php.net
Which SAPI are you using, cgi os isapi?
 [2002-11-28 11:48 UTC] briantmeyer at earthlink dot com
cgi

php.exe specifically
 [2002-11-28 17:44 UTC] briantmeyer at earthlink dot com
CGI
c:\php\php.exe %s %s
is the command line in the application mappings

I can install it again if you want me to try something
(i just swap out contents of the php folder, iis isn't 
changed)
 [2002-11-29 00:52 UTC] edink@php.net
In PHP 4.3.0 cgi binary is called php-cgi.exe. Could you try using that one and see if it fixes your problem?
 [2002-11-29 01:34 UTC] briantmeyer at earthlink dot com
changing to c:\php\php-cgi.exe %s %s works fine

works fine with Stable (4.3.x-dev)
http://snaps.php.net/win32/php4-win32-STABLE-
200211290130.zip
(I was just trying to see if it was better when i got your 
suggestion)

as well as
4.3.0RC2 as i originally had it.

I changed it back to c:\php\php.exe %s %s and the error 
recurs exactly as before so this is definitely the issue.

I think i'll leave it running 4.3.0RC2 with the correct IIS 
setup and see if there any more issues. From the pages i've 
looked at so far all the third-party projects as well as my 
stuff seem to be working fine.

Would be nice to have this put in the install.txt file that 
php.exe is no longer used directly by IIS, that php-cgi.exe 
is now being used in this version and should be changed. At 
least it would cut down on the number of bug reports since 
this is a fundamental difference that might not be noticed 
with the php.exe still being there. (It does still sort of 
work)
 [2002-11-29 01:57 UTC] derick@php.net
okay, we make it a documentation problem then.

Derick
 [2002-12-02 10:54 UTC] christian at wenz dot org
IMO this should definitively be included in the documentation - last week no less than 4 friends called me and complained that after upgrading to 4.3.x IIS would no longer run the scripts. They also just copied files and didn't notice that the CGI executable now has another name. Please put this in capital letters on the release notes (maybe even directly on the download page), otherwise we will get swamped by hundreds of bogus bug reports.
 [2003-01-02 20:32 UTC] nicos@php.net
It is now documented.

Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Aug 14 15:01:28 2024 UTC