Current time: 11-14-2024, 05:06 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: #1
curl crashes! How do I update curl?
Hi!

I've been struggling with a curl problem here for an entire day. In short the problem is:

* curl works fine with most requests.
* My site is running php5 under ispcp
PHP version: PHP Version 5.2.0-8+etch10
And libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5

- But when I do a curl request on a specific URL that returns binary data curl seems to crash. That is, the script dies and I get a http 500 error - There is no information to be found in any of the apache error logs.

If I enable verbose output in curl I can see that the negotiation with the remote server was fine - it's just as soon as the local server receives the binary data it crashes.

So, I tried throwing my script on another server which has a newer version of PHP and Curl - that is:
PHP Version 5.2.5
libcurl/7.16.1 OpenSSL/0.9.8g zlib/1.2.3

And here it works just fine!

So I want to try and update my libcurl from v. 7.15.5 to 7.16.1 or newer. How do I do this?

And apt-get install php5-curl just gives me "php5-curl is already the newest version"

Thank you for your time and input Smile

- zaber
04-19-2008 03:09 AM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #2
RE: curl crashes! How do I update curl?
use apt pining to install php and curl from testing repository...
04-19-2008 04:30 AM
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: #3
RE: curl crashes! How do I update curl?
rbtux Wrote:use apt pining to install php and curl from testing repository...

Thanks rbtux,

This unfortunately did not solve my problem. I got everything updated but curl still crashes on this server - so something else must be to blame (god knows what it might be though!)

Is there any way for me other than looking at the apache error logs to figure out why curl is crashing and I am getting this darn http 500 error?

In case anyone else wants to know how to update their php5 on debian running ispcp just do this:

edit the file /etc/apt/sources.list and add the following lines:

#Testing
deb http://ftp.de.debian.org/debian testing main non-free contrib

then go to /etc/apt/apt.conf.d/70debconf and add the following line:
APT::Cache-Limit "16777216";

then do e.g. "apt-get install php5-curl/testing"

Again thank you for your time Smile

- Zaber
04-19-2008 05:51 AM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #4
RE: curl crashes! How do I update curl?
well what you did can make debian going crazy ;-)

Better way is apt-pinning:

http://www.isp-control.net/forum/php5-cg...l#pid23244

you can add curl to...

Please try that and if it don't work give us as detailed info as possible about your system. Else it won't be possible for us to help you...
(This post was last modified: 04-19-2008 06:10 AM by rbtux.)
04-19-2008 06:09 AM
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: #5
RE: curl crashes! How do I update curl?
rbtux Wrote:well what you did can make debian going crazy ;-)

Better way is apt-pinning:

http://www.isp-control.net/forum/php5-cg...l#pid23244

you can add curl to...

Please try that and if it don't work give us as detailed info as possible about your system. Else it won't be possible for us to help you...


Hi - Wow that was WAY too german for me. I understand nothing, and I couldn't see anything that qualified as viable instructions. In any case, my method seemed to work (all websites on server are running fine) - So maybe I was just lucky Wink

Ok to recap the problem:

* Very simple curl code fails on my server - all I get when I run my test script is a http 500 error.

* Other curl calls work fine. It is just this one where I get binary data returned which crashes.

* This code works fine on another server as mentioned in my first post

* I have no clue how to track down what is actually causing the internal server error as the only place I know where to look is the apache logs - and there is nothing to see there of interest.

* When I make the curl code output log information using:
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, $curlerrors);

where $curlerrors point to my logfile - then I get the exact same result there as on the server where the function succeeds.

This is the curl log:
Quote:* About to connect() to postdanmark.dk port 80 (#0)
* Trying 193.3.68.126... * connected
* Connected to postdanmark.dk (193.3.68.126) port 80 (#0)
> POST /pfs/WebPackExport.csv HTTP/1.1
Host: postdanmark.dk
Accept: */*
Referer: http://postdanmark.dk/pfs/pfsExportFile....elcome.jsp
Cookie: PFS_NEW_USER=PRINT,WAYBILL,
Content-Length: 523
Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 200 OK
< Date: Fri, 18 Apr 2008 16:23:59 GMT
< Server: WebLogic WebLogic Temporary Patch for CR108446 07/01/2003 12:41:46
< Content-Type: application/binary-stream
< Transfer-Encoding: chunked
< Connection: Close
* Closing connection #0

Looks good to me. But why the heck does it crash??

I have no idea where to look for more info on this - If you need information on my system please let me know exactly what you need and I will happily provide it Smile

Thanks!

-Zaber
04-19-2008 06:30 AM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #6
RE: curl crashes! How do I update curl?
zabersoft Wrote:Hi - Wow that was WAY too german for me.

Sorry my fault... When you know what your doing you can use the method you described. BUT here are a lot admins that don't know very much about linux servers and the services running on and for this sort of admins the method with apt-pinning ist the better one...

Back to the problem. I haven't had any problems with curl yet so I don't know if I can be of much help.
Does it work when you use the curl code in a php file and execute that php file from the console? Maybe the fastcgi implementation doesnt send all headers that are needed for the proper function of your php curl code.
Try to encrase the loglevel of mod_fastcgi / apache if possible. Have you any fastcgi errors in your error.log while the script throws Error 500?
04-19-2008 08:49 AM
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: #7
RE: curl crashes! How do I update curl?
Hi again,

Interestingly enough we are getting closer to something here Smile
This is what I found:

* Running the script from the command line works! No problems or errors and I get beautiful output.

- This code still needs to live inside a regular PHP script that will be executed via. a browser - so this is not a solution Sad

* Setting the loglevel to debug yields no new results. All I see in error.log is my curl log info and then the usual "termination/start/restart" warn messages from FastCGI

So the problem seems to be with fastcgi since it works on the commandline but not via the browser - Any other suggestions on where to look?

Again - Thanks so much for your time and attention to this Smile

- Zaber
04-22-2008 04:19 AM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #8
RE: curl crashes! How do I update curl?
which versions are currently installed of php5-cgi / php5-cli / php5-curl ?
04-24-2008 05:03 AM
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: #9
RE: curl crashes! How do I update curl?
rbtux Wrote:which versions are currently installed of php5-cgi / php5-cli / php5-curl ?

ok let's see if this helps:

PHP/cli/cgi/curl Version 5.2.5-3
mod_fastcgi 2.4.2
libcurl 7.18.0
04-25-2008 07:22 AM
Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #10
RE: curl crashes! How do I update curl?
can you provide the scripts or example code that crashes in your installation?
04-25-2008 07:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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