NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[Ok] Different result between run under DBG/without DBG


Joined: 07 May 2006
Posts: 6
Reply with quote
Hi,

my script run under php5.1.2, under apache 2.2.0 and mysql 5.0.2.

when i run my php script under DBG, i haven't bug but if i run directly in IE or firefox then the result is crazy Shocked (read below for an exemple of result). If you had an answer, thanks a lot Cool

Code:

1f60
            <li><a href='index.php?axion=850.0.0.0.0&orpheline=oInteractivite.ocw'>Interactivité</a></li>
            <li><a href='index.php?axion=850.0.0.0.0&orpheline=oCommandes.ocw'>Gestion des commandes</a></li>
        </ul>
    </div>
                <div id="leftCol">
.
.
.
.
                <tr>
                    <form action='index.php' method='post' name='gopanier'>
                    <input type='hidden' name='ss_axion' value='520.0.0.0.0'>

HTTP/1.1 200 OK
Date: Sun, 07 May 2006 15:49:33 GMT
Server: Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.2
X-Powered-By: PHP/5.1.2
Set-Cookie: PHPSESSID=afdefc65187706f3ab997cd11f96b112; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

8876
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

.
.
.
.
                    <form action='index.php' method='post' name='gopanier'>
                    <input type='hidden' name='ss_axion' value='520.0.0.0.0'>
b-y-t-e-s
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

   <head>
<link rel="stylesheet" type="text/css" href="./chartes/standard/cavendish.css" media="screen" title="Cavendish"/>
<link rel="icon" href="/ecar-16.png" type="image/png" />
.
.
.
.


the output begin by a code 1f60,
after, block of html code normaly at middle of page,
after, an header of page etc...

only without DBG. why Question

thanks for your help

best regards

Jacques


Last edited by Jacques on Tue May 09, 2006 4:26 am; edited 1 time in total
View user's profileFind all posts by JacquesSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
Apache 2.2 is not compatible with Apache 2.0. Php binaries provided for php are compiled with Apache 1.3 (php5apache) and Apache 2 (php5apache2). Just don't use php under Apache 2.2 or compile php module yourself.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 May 2006
Posts: 6
Reply with quote
I use xampp (apache 2.2) or wampp (apache 2.0) with php5.1.2 provided with each package. and the same bug is present.
I will try to use Easy PHP with apache 1.3 and php5 and prevent you if it's ok

thanks

Jacques
View user's profileFind all posts by JacquesSend private message


Joined: 23 Aug 2005
Posts: 53
Reply with quote
Those numbers are "normal" output. It is the size if the result in bytes that will follow i believe.
View user's profileFind all posts by stappelSend private message


Joined: 09 Dec 2003
Posts: 92
Reply with quote
Yeah, that's "Transfer-Encoding: chunked".
View user's profileFind all posts by mpSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
ahh, right, that's a chuncked output. Apache uses it whenever Content-Length is not set.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 May 2006
Posts: 6
Reply with quote
thanks for your help but why apache send data before the end of script ?
so, It's the first time that i can see it.

i have implemented an little language in htmls pages and it's a piece of my interpreter script that produce this output when it read a specific piece of html.

my templates are :

Quote:
<c:for ....> html <c:endfor>

and
Quote:
<c:if eval="expression"> html <c:else> html <c:endif>


it's perhaps cause by my syntaxe of templates ?
View user's profileFind all posts by JacquesSend private message
[resolu]


Joined: 07 May 2006
Posts: 6
Reply with quote
It's ok,
the explanation is as follows:

with apache 1.3 the buffer is chuncked only when it's the end of script (after connection losted for example)
with apache 2.? the buffer is chuncked during the execution of script.

for to force apache to send only when the script is ended use ob_??? functions: ob_start() and ob_end_flush()....
ob_start on the first line of script
ob_end_flush after the last output

thank you for your assistance without which I will not have been able to find the answer

Jacques
View user's profileFind all posts by JacquesSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
That's right, except probably 1.3. It also outputs using chunked enconding. Eveerything depends on the script output itself. If it is done shortly and relatively small, there is good chance that Apache will get EOF before it finish accumulating data for the first chunck and in this case it will not do chunking and will supply Content-Length header. You may want to check what headers you get on the client.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 May 2006
Posts: 6
Reply with quote
how to obtain the headers get on the client ?
View user's profileFind all posts by JacquesSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
I think you'd need httpwatch or something like this
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Dec 2003
Posts: 92
Reply with quote
Google for Fiddler (a Microsoft tool IIRC, don't know if it works with Mozilla) or the LiveHeaders (or was it LiveHTTPHeaders?) extension for Firefox.

Also tcptrace is a handy GUI app for TCP dumping, but I cannot remember which one of the first respective Google matches it was...
View user's profileFind all posts by mpSend private message
[Ok] Different result between run under DBG/without DBG
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic