[PHP] need help with $HTTP_RAW_POST_DATA

2004-08-05 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi all, 

I am using a Debian server with all stable packages so PHP is version
4.1.2 

I was developing a SyncML server and was using $HTTP_RAW_POST_DATA as a
receiving container for incoming SyncML communication from my Sony
Ericsson T-616. Recently finished writing the WBXML convertor and are
working with the SyncML engine. 

Everything was working fine until i wanted to try to update to PHP5, but
there aren't any officially unstable/experiment PHP5 from Debian. So i got
mine from DotDeb.org. 

Everything worked but then $HTTP_RAW_POST_DATA suddenly is not receiving
any data. I recall reading in the PHP manual that $HTTP_RAW_POST_DATA is
disabled, i enabled it by setting always_populate_raw_post_data = On. It
did not work, so i removed PHP5 and reinstalled the stable version of PHP
which is 4.1.2 

$HTTP_RAW_POST_DATA is still not receiving any data. I looked into PHP
4.1.2's php.ini file and didn't see any parameter setting for
always_populate_raw_post_data which is not surprising since the default
disable is only active after 4.2.0 

I added that line anyway and restarted Apache, still the
$HTTP_RAW_POST_DATA is not working. I know that XML RPC uses this global
variable for parsing XML data as well, so it should be empty. 

Anyone know what is going on and how to fix it? It was working fine before
i upgraded and then it was just broken after that. 

Since $HTTP_RAW_POST_DATA is going to be disabled by default, is there a
better variable to be used for receiving communication data? 

I noticed php://input but that's going to be changed to php://filter, but
i have never tried using that before either. So i have no idea how it
works. 

If anyone can help me reactivate $HTTP_RAW_POST_DATA or find a better way
to grab communication data, please HELP!! 

Thank you in advance 
Regards 
Mian

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] need help with $HTTP_RAW_POST_DATA

2004-08-05 Thread raditha dissanayake

Everything was working fine until i wanted to try to update to PHP5, but
there aren't any officially unstable/experiment PHP5 from Debian. So i got
mine from DotDeb.org. 
 

You could always copmpile from source.
Everything worked but then $HTTP_RAW_POST_DATA suddenly is not receiving
any data. I recall reading in the PHP manual that $HTTP_RAW_POST_DATA is
disabled, i enabled it by setting always_populate_raw_post_data = On. It
did not work, so i removed PHP5 and reinstalled the stable version of PHP
which is 4.1.2 
 

I am suprised that it ever worked for you. According to my understanding 
raw post data is available only if the content type is unrecognized by 
the php engine - assuming that you were infact using such a content type 
then it shouldn't stop working all of a sudden.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] need help with $HTTP_RAW_POST_DATA

2004-08-05 Thread Curt Zirzow
* Thus wrote PHPDiscuss - PHP Newsgroups and mailing lists:
 I noticed php://input but that's going to be changed to php://filter, but
 i have never tried using that before either. So i have no idea how it
 works. 

The only time php://input will have the data sent from the client
is if php doesn't read in any of the data.  You can force php not
to read that by setting the php.ini post_max_size to a small
number.

Then you can simply do something like:

($fp = fopen('php://input', 'r')) or die('cant open input');

while (! feof($fp) ) {
  echo fgets($fp);
}

Although a slight hack, it is much more effecient with memory,
expecially if you are expecting lots of data.

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php