Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29221 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58631 invoked by uid 1010); 6 May 2007 18:59:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58616 invoked from network); 6 May 2007 18:59:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 May 2007 18:59:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 82.135.69.97 cause and error) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 82.135.69.97 ppp-82-135-69-97.dynamic.mnet-online.de Received: from [82.135.69.97] ([82.135.69.97:57205] helo=johannes.nop) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/45-06274-4752E364 for ; Sun, 06 May 2007 14:59:01 -0400 Received: from johannes.nop (localhost [127.0.0.1]) by johannes.nop (8.13.8/8.13.8) with ESMTP id l46Iwtbi027475; Sun, 6 May 2007 20:58:56 +0200 Received: (from johannes@localhost) by johannes.nop (8.13.8/8.13.8/Submit) id l46IwnoK027473; Sun, 6 May 2007 20:58:49 +0200 X-Authentication-Warning: johannes.nop: johannes set sender to johannes@php.net using -f To: "Unknown W. Brackets" Cc: internals@lists.php.net In-Reply-To: <05.C4.06274.89F1E364@pb1.pair.com> References: <20070504201847.547329627@smtp.haun-online.de> <05.C4.06274.89F1E364@pb1.pair.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sun, 06 May 2007 20:58:48 +0200 Message-ID: <1178477928.4640.62.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Subject: Re: [PHP-DEV] Re: Bug? Raw POST data in PHP 5.2.2, take two From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hello "Unknown", you are wrong, the name is right please learn your lessons before writing to internals. To the original problem: Ilia committed a fix a few hours ago which should fix the problem. Feel free to test a current snapshot. johannes On Sun, 2007-05-06 at 11:34 -0700, Unknown W. Brackets wrote: > It sounds like you have register_globals off, which is a good thing imho. > > You are trying $HTTP_RAW_POST_DATA but my recollection tells me it is > $_SERVER['HTTP_RAW_POST_DATA']. Does the latter work? > > Anyway, reading from php://input is more correct and doesn't depend on > PHP settings as much, as far as I know. > > -[Unknown] > > > -------- Original Message -------- > > > I believe this is a bug in PHP 5.2.2. I've tried to report this for PHP > > 5.2.2RC2 but apparently wasn't making myself clear or wasn't following > > the proper procedures ... > > > > Anyway, as I wrote before[1], "raw" POST data isn't making it through in > > PHP 5.2.2 which results in XML-RPC communications to fail, at least when > > using the PEAR::XML_RPC package. > > > > Consider this little script (send.php): > > > > --- snip --- > > > > > require_once 'XML/RPC.php'; > > > > $sourceURI = 'http://www.example.com/'; // doesn't matter here > > $targetURI = $sourceURI; > > > > $client = new XML_RPC_Client('/receive.php', $_SERVER['HTTP_HOST']); > > $client->setDebug(1); > > $msg = new XML_RPC_Message('pingback.ping', > > array(new XML_RPC_Value($sourceURI, 'string'), > > new XML_RPC_Value($targetURI, 'string'))); > > > > $response = $client->send($msg, 0, 'http'); > > > > ?> > > --- snip --- > > > > This makes a simple XML-RPC call as used for Pingbacks. For the > > receiving end of the communication, let's use this as receive.php: > > > > --- snip --- > > > > > print_r(getallheaders()); > > > > echo $GLOBALS['HTTP_RAW_POST_DATA'] . "\n\n"; > > > > ?> > > --- snip --- > > > > Now when I call up send.php (both located in the web root of a server > > running PHP 5.2.2), I get this output: > > > > ---GOT--- > > HTTP/1.1 200 OK > > Date: Fri, 04 May 2007 20:07:58 GMT > > Server: Apache/1.3.37 (Unix) PHP/5.2.2 > > X-Powered-By: PHP/5.2.2 > > Connection: close > > Content-Type: text/html > > > > Array > > ( > > [Content-Length] => 282 > > [Content-Type] => text/xml > > [Host] => myhost.example.com > > [User-Agent] => PEAR XML_RPC > > ) > >
> > Notice: Undefined index: HTTP_RAW_POST_DATA in /usr/local/ > > apache/vhost/geeklog/public_html/receive.php on line 5
> > > > ---END--- > > > > So $GLOBALS['HTTP_RAW_POST_DATA'] is not set. The PEAR::XML_RPC package > > actually uses $HTTP_RAW_POST_DATA on the receiving end, but that doesn't > > appear to be set either. And the always_populate_raw_post_data option in > > php.ini doesn't make a difference. > > > > Switching back to PHP 5.2.1 (same machine, same configuration) makes > > everything work as expected: > > > > ---GOT--- > > HTTP/1.1 200 OK > > Date: Fri, 04 May 2007 20:11:28 GMT > > Server: Apache/1.3.37 (Unix) PHP/5.2.1 > > X-Powered-By: PHP/5.2.1 > > Connection: close > > Content-Type: text/html > > > > Array > > ( > > [Content-Length] => 282 > > [Content-Type] => text/xml > > [Host] => myhost.example.com > > [User-Agent] => PEAR XML_RPC > > ) > > > > > > pingback.ping > > > > > > http://www.example.com/ > > > > > > http://www.example.com/ > > > > > > > > > > ---END--- > > > > This is on a Linux box, but I have confirmation (thanks, Mike) of the > > same thing happening on Windows. > > > > Can anyone please > > > > 1) confirm this or tell me what I'm doing wrong and > > 2) tell me what else I should have done (other than posting here and > > emailing Ilia, as the PHP 5 release manager), in case I ever run into > > something similar again. > > > > Thanks. > > > > bye, Dirk > > > > [1] > > > > >