I'm trying to install the php_http
PHP extension on my CentOS server.
I have done:
yum install php-pear
But get:
No package php-pear available
Yet I can do:
pear
And get a list of commands from Pear.
Same for yum install pecl
. I can do pecl
but pecl install pecl_http
returns:
No releases available for package "pecl.php.net/pecl_http"
install failed
Yet /usr/bin/pecl
isn't a directory that exists. Also a sudo pecl install pecl_http
returns sudo: pecl: command not found
, which I find quite odd.
I'm not entirely sure what's going on here/what I'm doing wrong.
edit: I am using the following repos:
base CentOS-6 - Base
epel Extra Packages for Enterprise Linux 6 - x86_64
extras CentOS-6 - Extras
rpmforge RHEL 6 - RPMforge.net - dag
updates CentOS-6 - Updates
vz-base vz-base
vz-updates vz-updates
After watching a lot of threads and installing pear and all the devtool, I finally solved it installing this extension:
as I seen in - https://madcoda.com/2012/12/install-mongodb-php-driver-in-centos-6-3/
Whatever your PHP provider is (IUS, Remi or Webtatic), the pear package and the pecl extensions "should" be available there, without any need to compile it from sources (which is usually discouraged, especially on production)
At least "remi" provides most extensions, see the list
So installation should be as simple as
And, don't forget to read the Wizard instructions
if you are running php 7 you might want to try this
if you get any errors, be sure to uninstall the pear package from any previous attempts
best of luck
For other people having this problem. I discovered this question while trying to figure out why I was having the same problem. Turned out the default configuration at my hosting provider was to include
php*
in theexclude
directive for yum. Check/etc/yum.conf
and make sure that the package you're trying to install isn't matched by an entry in theexclude
directive.On CentOS,
Install PHP Pear if not installed yet:
Install GCC if not installed yet:
Install cURL if not installed yet:
Install following libraries if not installed yet:
Start the main installation:
Add the following line to /etc/php.ini file
Restart apache server so the extension can be loaded
You can check if it installed successfully or not:
Centos 6.5 and php7:
you can get last version of lua : http://pecl.php.net/package/lua