Current time: 11-13-2024, 05:19 PM Hello There, Guest! (LoginRegister)


Post Reply 
curl crashes! How do I update curl?
Author Message
zabersoft Offline
Junior Member
*

Posts: 14
Joined: Apr 2008
Reputation: 0
Post: #11
RE: curl crashes! How do I update curl?
rbtux Wrote:can you provide the scripts or example code that crashes in your installation?

Hi!

I think I have located the problem - maybe it's a buffer overflow issue or something of the sort. In any case, after much headscratching I tried a workaround solution by putting the script on the server that worked and then use curl to fetch the output to my own server. Now, this still crashed! Which it shouldn't if it was a response/header problem with the remote server that I have no control over.

So - I did a little experiment - I took the output and saved it as a html file - then from my own server I ran this simple code:

Code:
$url = "http://www.zabersoft.com/trendy/test.html";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    $html = curl_exec($ch);
    curl_close ($ch);

And it crashes!

Try going to that URL - It's just plain old text. But for some reason this makes the server puke all over the place and return http 500

Any ideas what is going on???

Thanks!

Zaber
04-25-2008 09:32 AM
Find all posts by this user Quote this message in a reply
zabersoft Offline
Junior Member
*

Posts: 14
Joined: Apr 2008
Reputation: 0
Post: #12
RE: curl crashes! How do I update curl?
Aaaargh!

Ok I might have been a bit too fast on stating that the above crashes. Well - It does, but only sporadically.

Fetching from the original URL always crashes - I will give it out here eventhough it is a bit sensitive information - but for the greater good:

Code:
$url = "http://www.zabersoft.com/trendy/webpack_fetch.php?from=24-04-2008&to=25-04-2008";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    $html = curl_exec($ch);
    curl_close ($ch);

Anyway - This ALWAYS crashes - Whilst $url = "http://www.zabersoft.com/trendy/test.html";

Sometimes crashes. As you can see it is the same output.

If you can find the difference and/or reproduce this and track this down you will be my official hero! Smile

PS: please be patient with webpack_fetch.php - The remote server is a bit slow.

Thanks

Zaber
(This post was last modified: 04-25-2008 09:47 AM by zabersoft.)
04-25-2008 09:45 AM
Find all posts by this user Quote this message in a reply
zabersoft Offline
Junior Member
*

Posts: 14
Joined: Apr 2008
Reputation: 0
Post: #13
RE: curl crashes! How do I update curl?
Ok after much new experimentation I have come to the conclusion that all this madness is a simple timeout issue. I noticed that it didn't matter WHAT the data was, but rather via. which script I was getting it.

So I timed the scripts - and on the server where it works, then the request can take up to 52 seconds to complete. Whilst on my own server running ispcp it errors out with the http 500 error after around 30 to 33 seconds.

Which would make sense when I look at the max_execution_time in php.ini

However - after having changed to:

php.ini
max_execution_time = 300

httpd.conf
Timeout 300

and setting
curl_setopt($curl_session, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($curl_session, CURLOPT_TIMEOUT, 600);

in my request - The script still dies after ~30 seconds

And yes, I have restarted Apache after the changes.

What the heck???

Zaber
04-25-2008 10:27 AM
Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #14
RE: curl crashes! How do I update curl?
Do you use fastcgi or mod_php ?
Just because if you're running fastcgi (the default for ispCP) you'll need to set the max_execution time in the right php.ini (otherwise it will be overriden with the values found in /var/www/fcgi/<domain>.<tld>/php5/php.ini ....
04-25-2008 06:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
zabersoft Offline
Junior Member
*

Posts: 14
Joined: Apr 2008
Reputation: 0
Post: #15
RE: curl crashes! How do I update curl?
ephigenie Wrote:Do you use fastcgi or mod_php ?
Just because if you're running fastcgi (the default for ispCP) you'll need to set the max_execution time in the right php.ini (otherwise it will be overriden with the values found in /var/www/fcgi/<domain>.<tld>/php5/php.ini ....

Hi,

I'm using the standard fastcgi and I have changed php ini for both php4 and php5 on the domain in question in /var/www/fcgi etc.

But it is not working. The script still dies after 30 seconds. In addition to this I changed php.ini for mod_php just for safety sake. But still no joy.

What might be going on??

Thanks,

Zaber
04-28-2008 06:03 AM
Find all posts by this user Quote this message in a reply
zabersoft Offline
Junior Member
*

Posts: 14
Joined: Apr 2008
Reputation: 0
Post: #16
RE: curl crashes! How do I update curl?
UPDATE: I HAVE MOVED THIS QUESTION TO A NEW THREAD:

http://www.isp-control.net/forum/how-to-...-3167.html


PS: This is what phpinfo() gives me:

Configuration File (php.ini) Path /etc/php5/cgi
Loaded Configuration File /var/www/fcgi/xxxx.dk/php4/php.ini
Scan this dir for additional .ini files /etc/php5/cgi/conf.d

Why is it using php4 ini when php5 is loaded? In any case, all php.ini files have been changed from 30 to 300 seconds in addition to my earlier changes. My server still kills the script after 30 seconds.

Thanks

Zaber
(This post was last modified: 04-30-2008 02:26 AM by zabersoft.)
04-28-2008 06:08 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)