Recompile php with curl

Post compiled php 5.4 curl installation

I realize now that I do not have cURL installed. I don’t know how to install cURL after a compiled installation of php. Using yum install php-curl installs cURL for php 5.3. I tried this already with an apache restart and it did not show up on my phpinfo file. How do I install cURL under these circumstances?

As you have the chosen to go the way of self-compiling you will have to stay with that. So, download the source package and compile it.

1 Answer 1

As you’ve install PHP from source, you’ll need to recompile PHP to include CURL.

# Return to PHP source directory sh ~> cd /path/to/php/src # Clean previus build sh ~> make clean # Configure with CURL sh ~> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl # Compile & Reinstall PHP sh ~> make sh ~> sudo make install 

Enable CURL without re-installing

Another option would be to build a shared-object CURL extension, and enable it within your php.ini file. The configuration format for PHP shared-object follows —with-=shared, . Repeat the make clean step, and use the following configuration flags:

# Configure CURL for shared object ( you may need to use --with-curl=shared,/usr ) sh ~> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl=shared # Compile sh ~> make # Copy shared-object to php extensions (paths may differ) sh ~> sudo cp -p modules/curl.so /usr/local/lib/php/extensions/no-debug-non-zts-BUILD_ID/curl.so # Enable CURL into systems php.ini sh ~> sudo echo 'extension=curl.so' >> /usr/local/lib/php.ini 

Easiest way to test if curl is enabled

# List all PHP modules & filter on CURL sh ~> /usr/local/bin/php -m | grep curl curl 

Источник

Читайте также:  Пример 2

Recompile php with curl

Здравствуйте!Подскажите пожалуйста как можно перекомпилировать PHP?Есть может какое-то описание пошаговое в сети как это делается?отелось бы ссылочку заиметь:)Или может кто здесь может кратко и понятно описать что для этого требуется? Искал по инету,не нашел почти ничего,за исключением некоторых обрывков,по которым не удалось восстановить полную картину Затевается это все для того,чтоб скомпилировать PHP с поддержкой известной библиотеки Curl.Заранее всем спасибо!

pnp2000
не знаешь, лучше промолчи 😡

pnp2000
не знаешь, лучше промолчи 😡
А всё допёрло , я то думал имелся ввиду не ядро/интерпритатор а сам PHP как язык , то называется Веб-программирование и скрипты вот и ступил , тока щас допёрло из контескта ответа , сори
ps : А вобще на форуме есть раздел Программирование , и подобный вопрос следовало бы поместить туда

pnp2000
не знаешь, лучше промолчи 😡

ок,по функциям понятно,там все ясно,но все еще не понятно как его перекомпилировать.вот например кусок из рhp-manul:

To use PHP’s CURL support you must also compile PHP —with-curl[=DIR]
where DIR is the location of the directory containing the lib and include
directories. In the «include» directory there should be a folder named «curl»
which should contain the easy.h and curl.h files. There should be a file
named libcurl.a located in the «lib» directory. Beginning with PHP 4.3.0 you
can configure PHP to use CURL for URL streams —with-curlwrappers.

больше ничего по самому методу перекомпиляции ПХП по первому линку нет.если зайти на второй,то там пишут:

./configure —prefix=/usr —with-ssl
make
make install

Я нахожусь под ОС WINXP SP2,IIS6.0 куда мне это все вписывать?В коммандной строке о комманде make никто не слышал.Никакого файла конфигурации в папке,где стоит PHP нет.Я в растерянности :молись:

я так подозреваю, тебе понадобится компилятор С/С++ (как минимум)

а вообще, никогда не слышал, чтобы кто-то перекомпилировал РНР под виндой. кстати, а почему обязательно перекомпилировать? подключить модуль не поможет?

Источник

Lik`s forum

Recompile cPanel internal PHP with Curl/CurlSSL support

Recompile cPanel internal PHP with Curl/CurlSSL support

by 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

Founder

lik Founder
Posts: 497 Joined: Wed Dec 15, 2010 3:21 am

Источник

Оцените статью