DIDZAN ORO's picture

Hello, 

I'm working with PHP in a core Turnkey, but I'm needing pecl_php to make HttpRequest from my php files. I noted that this library or extension doesn't come with PHP, but is not installed and I'm having issues to install it. Any help with this.

Regards,

Didzan

Forum: 
Jeremy Davis's picture

First update your local package list from the repos:
apt-get update
Then you can search the repos with apt-cache; like this:
apt-cache search --names-only php pecl
And that tells you that the name is php5-pecl-http so install with apt-get, like this:
apt-get install php5-pecl-http
DIDZAN ORO's picture

Good morning,

Thanks for your help. But I search with

apt-cache search --names-only php pecl

and didn't show me anything.

I also ran 

apt-get install php5-pecl-http

and shows this: E: Unable to locate package php5-pecl-http.

 

Any idea why I'm getting this?

DIDZAN ORO's picture

A little more info. I get this when I was installing:

pecl install pecl_php

ERROR: `/tmp/pear/temp/pecl_http/configure --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr --with-http-libidn-dir=/usr' failed

Jeremy Davis's picture

Are you using v14.0? Does your server have internet access? If the answer to both of your questions is yes and my above commands don't work then something is seriously wrong!

On TKL v14.0 Core:

apt-get update
gives me:
Hit http://security.debian.org jessie/updates InRelease
Hit http://security.debian.org jessie/updates/main amd64 Packages
Hit http://security.debian.org jessie/updates/contrib amd64 Packages
Hit http://security.debian.org jessie/updates/contrib Translation-en
Hit http://security.debian.org jessie/updates/main Translation-en
Ign http://archive.turnkeylinux.org jessie-security InRelease
Ign http://archive.turnkeylinux.org jessie InRelease
Hit http://archive.turnkeylinux.org jessie-security Release.gpg
Ign http://http.debian.net jessie InRelease
Hit http://archive.turnkeylinux.org jessie Release.gpg
Hit http://archive.turnkeylinux.org jessie-security Release                     
Hit http://http.debian.net jessie Release.gpg
Hit http://archive.turnkeylinux.org jessie Release
Hit http://archive.turnkeylinux.org jessie-security/main amd64 Packages
Hit http://http.debian.net jessie Release
Hit http://archive.turnkeylinux.org jessie/main amd64 Packages
Hit http://http.debian.net jessie/main Sources
Hit http://http.debian.net jessie/contrib Sources
Hit http://http.debian.net jessie/main amd64 Packages
Hit http://http.debian.net jessie/contrib amd64 Packages
Hit http://http.debian.net jessie/contrib Translation-en
Hit http://http.debian.net jessie/main Translation-en
Ign http://archive.turnkeylinux.org jessie-security/main Translation-en
Ign http://archive.turnkeylinux.org jessie/main Translation-en
Reading package lists... Done
and
apt-get install php5-pecl-http
gives me:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libonig2 libperl4-corelibs-perl libqdbm14 lsof php-pear php5-cli php5-common php5-json php5-propro php5-raphf
Suggested packages:
  php5-dev php5-user-cache
Recommended packages:
  php5-readline
The following NEW packages will be installed:
  libonig2 libperl4-corelibs-perl libqdbm14 lsof php-pear php5-cli php5-common php5-json php5-pecl-http
  php5-propro php5-raphf
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 3899 kB of archives.
After this operation, 14.3 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Add new comment