The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

curl_exec and https

Discussion in 'General Discussion' started by bobbybobbertson, Nov 29, 2006.

  1. bobbybobbertson

    bobbybobbertson Well-Known Member

    Joined:
    May 30, 2003
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    I'm having problems with a line of php code that uses curl_exec. If I set the curl parameters for the URL for it to retrieve "http", it works just fine. If I set the URL to "https", the script dies with the output to the browser:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    The error log only shows "premature end of script" and suexec log shows nothing.

    curl works fine from the command line with https.

    The following SSL line did not help:
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

    I don't think the problem is with the certificate, as the requested file is retrieved. If I set the following, the output is sent to the screen, however nothing in the script after the curl_exec command is executed, so the script still dies:
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);

    So curl_exec retrieves the info from the URL, but dies immediately after it displays its output. Any ideas?

    Thanks,
    bobby


    My server info:

    WHM 10.8.0 cPanel 10.9.0-S80
    RedHat 9 i686 - WHM X v3.1.0

    PHP Version 5.2.0

    libcurl/7.15.3 OpenSSL/0.9.7a zlib/1.2.3

    Server Version: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
    Server Built: Nov 21 2006 00:25:36

    './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--with-pspell' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--with-zlib'
     
    #1 bobbybobbertson, Nov 29, 2006
    Last edited: Dec 1, 2006
  2. mehrdad abed

    mehrdad abed Well-Known Member

    Joined:
    Mar 18, 2006
    Messages:
    127
    Likes Received:
    0
    Trophy Points:
    16
    install "CurlSSL" as well and see it works or not.
     
Loading...

Share This Page