Recompile cPanel internal PHP with Curl/CurlSSL support

Here you can find tutorials and notes for server-side maintenance/configuration

Recompile cPanel internal PHP with Curl/CurlSSL support

Postby lik » Wed Jan 11, 2012 11:14 pm

To recompile internal cPanel PHP with Curl/CurlSSL support which may be required for additional cPanel plugins/addons one should adjust internal PHP profile first.
Let`s check current settings set in the profile:
Code: Select all
# grep -i curl /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
Cpanel::Easy::PHP4::Curl: 0
Cpanel::Easy::PHP4::CurlSSL: 1
Cpanel::Easy::PHP5::Curl: 0
Cpanel::Easy::PHP5::CurlSSL: 1
Cpanel::Easy::PHP5::Curlwrappers: 0

Modify profile for your needs (in this particular case enable Curl/CurlSSL):
Code: Select all
perl -i -pe 's/Cpanel::Easy::PHP4::Curl: 0/Cpanel::Easy::PHP4::Curl: 1/g' /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
perl -i -pe 's/Cpanel::Easy::PHP4::CurlSSL: 0/Cpanel::Easy::PHP4::CurlSSL: 1/g' /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
perl -i -pe 's/Cpanel::Easy::PHP5::Curl: 0/Cpanel::Easy::PHP5::Curl: 1/g' /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
perl -i -pe 's/Cpanel::Easy::PHP5::CurlSSL: 0/Cpanel::Easy::PHP5::CurlSSL: 1/g' /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
perl -i -pe 's/Cpanel::Easy::PHP5::Curlwrappers: 0/Cpanel::Easy::PHP5::Curlwrappers: 1/g' /var/cpanel/easy/apache/profile/makecpphp.profile.yaml

Or one-line magic (thanks to Vlad):
Code: Select all
perl -i -pe 's/Cpanel::Easy::PHP(\d*)::Curl(\S*): 0/Cpanel::Easy::PHP$1::Curl$2: 1/g' /var/cpanel/easy/apache/profile/makecpphp.profile.yaml

Verify changes:
Code: Select all
# grep -i curl /var/cpanel/easy/apache/profile/makecpphp.profile.yaml
Cpanel::Easy::PHP4::Curl: 1
Cpanel::Easy::PHP4::CurlSSL: 1
Cpanel::Easy::PHP5::Curl: 1
Cpanel::Easy::PHP5::CurlSSL: 1
Cpanel::Easy::PHP5::Curlwrappers: 1

And finally execute script to rebuild cPanel's internal PHP installation:
Code: Select all
/scripts/makecpphp
lik
Founder
Founder
 
Posts: 487
Joined: Wed Dec 15, 2010 3:21 am

Return to Server Side Actions

 


  • Related topics
    Replies
    Views
    Last post