Call to undefined function curl_init() How to solve this ?

serverack

Member
Aug 14, 2011
12
0
51
cPanel Access Level
Root Administrator
Hi,
I am developing cpanel plugin which will connect it to amazon, I have attached its screenshot.
cp2s31.JPG
It is throwing error : Call to undefined function curl_init()

I googleed around and came to know that it give such error when cURL is not installed so I recompiled PHP with 5.3x including cURL.

I rebooted server but still getting same error.

How can I solve this ?
 

sirdopes

Well-Known Member
PartnerNOC
Sep 25, 2007
141
0
66
You will need to recompile cpanel's internal php with curl support. This is a different installation than the version that apache uses. You can do this in ssh by running the command /scripts/makecpphp. You might also need to edit /var/cpanel/easy/apache/profile/makecpphp.profile.yaml and set the following two lines to 1.

Cpanel::Easy::PHP5::Curl: 1
Cpanel::Easy::PHP5::CurlSSL: 1
 
Last edited:

tsiedsma

Active Member
Nov 1, 2006
27
0
151
US
cPanel Access Level
Root Administrator
I'm having this same issue. I realize this thread is old, but there aren't any newer threads.
I've changed the following in my /var/cpanel/easy/apache/profile/makecpphp.profile.yaml.

Cpanel::Easy::PHP5::Curl: 1
Cpanel::Easy::PHP5::CurlSSL: 1

upon execution of /scripts/makecpphp, the variables get reset. to this:

Cpanel::Easy::PHP5::Curl: 0
Cpanel::Easy::PHP5::CurlSSL: 1

Regardless, after a successful build, curl_init still does not work. This is only affecting the 3rdparty php.

/usr/local/cpanel/3rdparty/bin/php -m does not show curl listed either. Is there a way to force the cpphp to install curl?