2009-12-19 9 views
9

Come per titolo, sto semplicemente cercando di installare l'estensione pecl_http per php in ubuntu.Installazione di pecl_http in xubuntu

Così ho fatto ciò che rende più senso:

[email protected] ~ $ sudo pecl install pecl_http 
downloading pecl_http-1.6.6.tgz ... 
Starting to download pecl_http-1.6.6.tgz (173,645 bytes) 
.....................................done: 173,645 bytes 
71 source files, building 
running: phpize 
Configuring for: 
PHP Api Version:   20041225 
Zend Module Api No:  20060613 
Zend Extension Api No: 220060519 
1. whether to enable cURL HTTP requests; specify libcurl directory : yes 

1-1, 'all', 'abort', or Enter to continue: 
1. whether to enable support for gzencoded/deflated message bodies; specify zlib directory : yes 

1-1, 'all', 'abort', or Enter to continue: 
1. whether to enable response content type guessing; specify libmagic directory : no 

1-1, 'all', 'abort', or Enter to continue: 
1. whether to depend on extensions which have been built shared : yes 

1-1, 'all', 'abort', or Enter to continue: 
building in /var/tmp/pear-build-root/pecl_http-1.6.6 
running: /tmp/pear/temp/pecl_http/configure --with-http-curl-requests --with-http-zlib-compression --with-http-magic-mime=no --with-http-shared-deps 

checking for grep that handles long lines and -e... /bin/grep 
checking for egrep... /bin/grep -E 
checking for a sed that does not truncate output... /bin/sed 
checking for gcc... gcc 

.... <snip> 

checking for unistd.h... (cached) yes 
checking for gethostname... yes 
checking for getdomainname... yes 
checking for getservbyport... yes 
checking for getservbyname... yes 
checking for zlib.h... found in /usr 
checking for zlib version >= 1.2.0.4... 1.2.3.3 
checking for curl/curl.h... not found 
configure: error: could not find curl/curl.h 
ERROR: `/tmp/pear/temp/pecl_http/configure --with-http-curl-requests --with-http-zlib-compression --with-http-magic-mime=no --with-http-shared-deps' failed 

così Ok, non ho ricciolo nel sistema, in modo da fare

[email protected] ~ $ sudo apt-get install php5-curl 

Curl installato benissimo, così ho provato a installare php5-http di nuovo, ma ancora lo stesso errore.

Chiunque può condividere una luce per favore? :(

-aw

risposta

19

Il messaggio che si stanno ottenendo, non indica che il pacchetto ricciolo PHP manca.

Invece, il problema è che non sembrano avere il "sistema" ricciolo pacchetto - o, almeno, non nella sua versione "sviluppo", che contiene i file necessari per compilare pecl_http

a giudicare da una rapida apt-cache search:

$ LANG=en apt-cache search libcurl dev 
libcurl4-gnutls-dev - Development files and documentation for libcurl (GnuTLS) 
libcurl4-openssl-dev - Development files and documentation for libcurl (OpenSSL) 
... 
.

Probabilmente è necessario installare libcurl4-gnutls-dev o libcurl4-openssl-dev.
(L'ultima volta che ho compilato PHP, ho installato il primo uno di quelli, e mi ha permesso di compilare il PHP con supporto ricciolo abilitato)

+0

che risolto, grazie di per la pronta risposta: D. –

+0

Prego :-) Buon divertimento! –

10

o .. solo sudo apt-get install libcurl3-dev fornirà curl/curl.h e l'installazione pecl_http continuerà

1

questo è lavorato sulla mia Ubuntu 12,10

sudo apt-get install libcurl3-openssl-dev 
sudo pecl install -a pecl_http 

sudo sh -c "echo 'extension=http.so' > /etc/php5/mods-available/http.ini" 
sudo ln -s /etc/php5/mods-available/http.ini /etc/php5/conf.d/ 

sarà necessario riavviare il server web, di avere questo modulo caricato.

sudo service apache2 restart 
or 
sudo service nginx restart