Re: PHP 4.0 Bug #6419: Curl output has extra data in output
| From: | Sterling Hughes | Date: | Tue, 29 Aug 2000 19:17:45 +0000 |
| Subject: | Re: PHP 4.0 Bug #6419: Curl output has extra data in output | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-31110@lists.php.net to get a copy of this message | ||
> From: medvitz@medvitz.net
> Operating system: Linux
> PHP version: 4.0 Latest CVS (29/08/2000)
> PHP Bug Type: Other
> Bug description: Curl output has extra data in output
>
>
>
> I've got two test programs as listed.
>
> test.php
>
> <?
> phpinfo();
> ?>
>
> test1.php
>
> <?
> $ch = curl_init("http://10.0.0.100/test.php");
> curl_setopt($ch,CURLOPT_HEADER,0);
> curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
> curl_setopt($ch,CURLOPT_POST,1);
> curl_setopt($ch,CURLOPT_POSTFIELDS,"a=bb&r=beer");
> echo curl_exec($ch);
> curl_close($ch);
> ?>
>
> when I run test1.php through a browser, I get 'extra' characters
periodically through the page. The characters are 'Oêÿ¿vÀ@'.
>
> The php config is :
>
> ./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs'
> '--with-config-file-path=/etc/httpd'
'--enable-safe-mode'
> '--with-exec-dir=/usr/bin'
'--with-system-regex' '--disable-debug'
> '--enable-debugger'
'--enable-magic-quotes' '--enable-track-vars'
> '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--with-xml'
> '--with-ftp' '--with-pgsql'
'--enable-wddx' '--with-curl=../curl-7.1.1' '--with-zlib'
>
>
To someone who knows a little more about Apache (I've never encountered this
problem, could someone else also confirm this so we know its not the users
machine),
I see gd.c (in php_image_output()) has a test to see whether or not APACHE
and CHARSET_EBCDIC are defined, if they are the following code is put in:
SLS_FETCH();
ap_bsetflag(php3_reqst->connection->client, B_EBCDIC2ASCII, 0);
It say since its a binary file it is to avoid the conversion. Could this be
related to the above problem (I don't think it is, but its just a guess)?
To the author, now you have some options:
1) output the data directly (tell me if this works for you, please)
2) output it to a file and then read it into your variable (this is
basically what the cURL code does for you, tell me if this works or not)
3) Finally you can simply preg_replace() all of the characters (or
str_replace() them one at a time), it doesn't look like they show up often
in the webpage itself (do they show up together in the bad output?)
Also, could you give me a sample of some failed output?
Did this happen in a previous CVS?
-Sterling