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.

Need to enable Curl in apache/php

Discussion in 'EasyApache' started by shufil, Jul 11, 2014.

  1. shufil

    shufil Well-Known Member

    Joined:
    Mar 19, 2014
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello friends,

    I need to enable Curl in php/apche , so first i try with this ,
    edit the file : /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
    Change the following from :
    Cpanel::Easy::PHP5::Curl: 0
    Cpanel::Easy::PHP5::CurlSSL: 1
    To
    Cpanel::Easy::PHP5::Curl: 1
    Cpanel::Easy::PHP5::CurlSSL: 1
    After making the above changes execute : /scripts/makecpphp --force , but there not seems any file with makecpphp in /scripts folder .

    then i try with though WHM , its for i choose EasyApache , then choose manually option that time i go to next step that is

    Your profile has Apache 2.2.27 chosen to build
    Your currently running apache is Apache 2.2.26 , if i choose latest apache 2.2.7 , is this any problem with current running other modules ?. also next step choose php vertion , current php vertion is 5.2.17 but its not mentioned there , here can we choose None or need to update this too ,

    anybody please , i need to enable Curl in php/apache also we need to not disturb any other modules .

    Regards,
    Shufil
     
  2. shufil

    shufil Well-Known Member

    Joined:
    Mar 19, 2014
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,

    Can i get reply of my issue .

    Regards,
    Shufil
     
  3. shufil

    shufil Well-Known Member

    Joined:
    Mar 19, 2014
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello ,

    Still am waiting reply , am stuck on this movement , so please help .

    Regards,
    Shufil
     
  4. triantech

    triantech Well-Known Member

    Joined:
    Jul 1, 2014
    Messages:
    145
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Kochi, India, India
    cPanel Access Level:
    Root Administrator
    Shufil,

    You might need to recompile Apache/php using EasyApache and select the module curl ( from exhaustive list of modules )
    I dont think it will cause much issues in the minor upgrade of Apache/PHP. ( Dont worry about other modules) .They will be
    in-tact. Also, in PHP, dont select none ( your server will be without PHP :D ) . If you feel your codes wont have any compatible
    issues with PHP version upgrade, go ahead. Dont worry about already-built in modules. They wont get affected.
     
  5. shufil

    shufil Well-Known Member

    Joined:
    Mar 19, 2014
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello,

    Cuurentlly curl is enable with ssl , then i try to check this like this
    <?php
    echo '<pre>';
    var_dump(curl_version());
    echo '</pre>';
    ?>

    Save the file as testcurl.php and then run it as a php script.

    # php testcurl.php

    If cURL is disabled you will see this error.

    Fatal error: Call to undefined function curl_version() in testcurl.php on line 2

    If cURL is enabled you will see a long list of attributes, like this.

    array(9) {
    ["version_number"]=>
    int(461570)
    ["age"]=>
    int(1)
    ["features"]=>
    int(540)
    ["ssl_version_number"]=>
    int(9465919)
    ["version"]=>
    string(6) "7.11.2"
    ["host"]=>
    string(13) "i386-pc-win32"
    ["ssl_version"]=>
    string(15) " OpenSSL/0.9.7c"
    ["libz_version"]=>
    string(5) "1.1.4"
    ["protocols"]=>
    array(9) {
    [0]=>
    string(3) "ftp"
    [1]=>
    string(6) "gopher"
    [2]=>
    string(6) "telnet"
    [3]=>
    string(4) "dict"
    [4]=>
    string(4) "ldap"
    [5]=>
    string(4) "http"
    [6]=>
    string(4) "file"
    [7]=>
    string(5) "https"
    [8]=>
    string(4) "ftps"
    }
    }


    its meance curl is working fine with http and https .
    then i try to another code that is pass a url ( remote server ) with port number 8080 .
    so i getting error , couldn't connect to host ,

    any body get same problem , what i can do now , please advice .

    also i have a doubt that is in my server blocking 8080 port ?

    Regards,
    Shufil
     
  6. triantech

    triantech Well-Known Member

    Joined:
    Jul 1, 2014
    Messages:
    145
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Kochi, India, India
    cPanel Access Level:
    Root Administrator
    via shell try,

    -- telnet localhost 8080 ( check if the port is open )

    -- Also verify if you are able to get connections through to the remote server.
     
  7. shufil

    shufil Well-Known Member

    Joined:
    Mar 19, 2014
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator

    Hello,

    Thanks for replay .

    I try telnet localhost 8080 ,

    telnet localhost 8080
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    telnet: Unable to connect to remote host: Connection refused ,

    It means port 8080 need to open right ? for open can we use below command.
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
    or
    iptables -I OUTPUT -p tcp -d xxx.xxx.xxx.xxx --sport 8080 --dport 8080 -j ACCEPT

    i need to just open this port for perticulor ip address

    Please reply me .

    Regards,
    Shufil
     
  8. shufil

    shufil Well-Known Member

    Joined:
    Mar 19, 2014
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    hello,

    Then i added below command in iptable

    iptables -I OUTPUT -p tcp -d remoteserver ip --sport 8080 --dport 8080 -j ACCEPT
    iptables -A INPUT -m state --state NEW -m tcp -p tcp -d remoteserverip --dport 8080 -j ACCEPT

    but again i getting>> telnet localhost 8080
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    telnet: Unable to connect to remote host: Connection refused

    Regards,
    Shufil
     
  9. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    makecpphp is deprecated. It has been deprecated since cPanel 11.36. We announced this in the 11.36 release notes, which were last updated about a year and a half ago:

    cPanel & WHM 11.36 Release Notes

    Also, even when it did exist, makecpphp only affected the internal cPanel PHP, which is completely separate from the PHP that is used to host your sites.

    Do you have anything actually listening on port 8080 on localhost? If you do not, then that would be why your connection is refused. Run this command to see if anything is listening:

    Code:
    # netstat -nalp|grep :8080
    You may get better help if you describe exactly what you are trying to do with curl, exactly what you want to happen.
     
Loading...

Share This Page