Reply to Re: POST with curl causing Apache to lock up

Your name:

Reply:


Posted by Manuel Lemos on 11/18/41 11:44

Hello,

on 04/07/2006 07:14 AM Leo said the following:
> Can anyone help or offer some explanation with this problem:
>
> I'm trying to do a POST from one of my PHP pages, to another page on my
> site using curl.
> To maintain the session I'm sending the current session cookie in the
> headers using
>
> $headerArray = array("Cookie: " . session_name() . "=" .
> session_id());
>
> then
>
> curl_setopt( $ch, CURLOPT_HEADER, 1 );
> curl_setopt( $ch, CURLOPT_POST, 1 );
> curl_setopt( $ch, CURLOPT_POSTFIELDS, $postArray );
> curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0 );
> curl_setopt( $ch, CURLOPT_HTTPHEADER, $headerArray);
> curl_exec( $ch );
>
> The problem is, once this is submitted, Apache goes into an infinite
> loop and has to be restarted. This only happens when I send the
> current session cookie, if I change it slightly there's no problem
> (although obviously the session is lost).
>
> There seems to be mention of a similar problem on the post called 'CURL
> and $_SESSION problem' but the guy is trying to achieve something
> different so it doesn't get addressed.

It seems like a bug in the Curl library.

You may want to try this HTTP client class. You can enable debug output
and see the HTTP dialog to figure exactly what is going on. It supports
cookie handling, so it should work for your purposes:

http://www.phpclasses.org/httpclient


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация