Ubuntu pecl install pecl_http fail - php

I'm trying to install this extension but it fails in the configuration phase. I'm on ubuntu 12.04 and I have just installed these packages:
libcurl3-openssl-dev
php-http
libpcre3-dev
libcurl3
php-pear
php5-dev
PHP version:
PHP 5.3.10-1ubuntu3.14 with Suhosin-Patch (cli) (built: Sep 4 2014 07:08:49)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
Here is the log of the installation command:
sudo pecl install pecl_http
downloading pecl_http-2.1.1.tgz ...
Starting to download pecl_http-2.1.1.tgz (158,441 bytes)
.................................done: 158,441 bytes
64 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Enable extended HTTP support [yes] :
where to find zlib [/usr] :
where to find libcurl [/usr] :
where to find libevent [/usr] :
building in /tmp/pear/temp/pear-build-rootqE2kgU/pecl_http-2.1.1
running: /tmp/pear/temp/pecl_http/configure --with-http --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/home/gare88/Lib/Php/libevent-2.0.21-stable/
checking for grep that handles long lines and -e... /bin/grep
[... cut...]
checking for zlib.h... found in /usr
checking for zlib version >= 1.2.0.4... 1.2.3.4
checking for curl/curl.h... found in /usr
checking for curl-config... found: /usr/bin/curl-config
checking for curl version >= 7.18.2... 7.22.0
checking for SSL support in libcurl... yes
checking for openssl support in libcurl... no
checking for gnutls support in libcurl... no
checking for ares support in libcurl... no
checking for bundled SSL CA info... /etc/ssl/certs/ca-certificates.crt
checking for event2/event.h... not found
configure: WARNING: continuing without libevent support
checking for ext/raphf support... no
configure: error: Please install pecl/raphf and activate extension=raphf.so in your php.ini
ERROR: `/tmp/pear/temp/pecl_http/configure --with-http --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr' failed
It seems that is a problem with pecl/raphf so I tried:
sudo pecl install raphf
pecl/raphf is already installed and is the same as the released version 1.0.4
install failed
At the end of php.ini file located on /etc/php5/apache2/php.ini
I added the line:
extension=raphf.so
extension=propro.so
extension=http.so
Is there anything else I can try?

You need to install php-raphf from your package manager.
for me i installed the module using the following. In your case you should be able to switch out yum for apt-get.
sudo yum install php-raphf
sudo yum install php-propro
sudo pecl install pecl_http
The you will need to add extension = http.so to your php.ini file. But it looks like you have already done that.
pecl does not actually install the .so file that you are looking for.

if you have ubuntu 13 or 14, try pecl install pecl_http-1.7.6 as newer versions still do not load for some reason.

On Ubuntu 12.04.5 LTS this worked for me:
First install some prerequisites needed for compilation:
sudo apt-get install php-http
sudo apt-get install php5-dev
sudo apt-get install libcurl3
sudo apt-get install libpcre3-dev
sudo apt-get install libcurl4-openssl-dev
sudo pecl install raphf
sudo pecl install pecl_http-1.7.6
after that go to the folder /usr/lib/php5/modules and check if the libraries are there: raphf.so, propro.so and http.so.
If your php.ini (at /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini) does not contain these extensions, add them:
extension=http.so
extension=propro.so
extension=raphf.so
or using the absolute path to the files, e.g. extension=/usr/lib/php5/modules/http.so.
And as last step restart your webserver, thus loading the new configuration:
sudo service apache2 reload

Just to add to #mschuett's answer, I found that when I got the same error as the OP that changing my extension reference in the php.ini did the trick.
extension=raphf.so
to
extension=/usr/lib/php5/20121212/raphf.so
then
sudo pecl install pecl_http
Also setting the following will keep you from having to hand edit your php.ini file when a pecl installation wants to modify it:
pear config-set php_ini /etc/php5/apache2/php.ini
pecl config-set php_ini /etc/php5/apache2/php.ini
NOTE: This worked for Ubuntu 14.04 LTS.

run command
sudo yum install php-raphf
sudo yum install php-propro
sudo pecl install pecl_http
etc/phph5/apache2/conf.d
add two file
raphf.ini
add content
extension=raphf.so
solr.ini
add content
extension=raphf.so
add in php.ini file
extension=http.so extension=propro.so
extension=raphf.so
or
extension=/usr/lib/php5/20121212/raphf.so
extension=solr.so

I bump into this issue while trying to install pecl_http-2.6.0, raphf-1.1.2 and propro-1.0.2 on Ubuntu 16.04 and php-fpm5.6. I can't use apt to install raphf and propro (as #mschuett suggested) because apt can only install raphf 2.0.0 and propro 2.1.0 which works only for PHP 7.
I resolve the problem with the following steps without needing to update the php.ini nor using apt.
First of all, to get php-fpm to load a new extension, an .ini file must be added to /etc/php/5.6/mods-available. Then use phpenmod to enable the extension.
So to install and enable raphf-1.1.2,
$ pecl install raphf-1.1.2
$ echo "extension=raphf.so" >> /etc/php/5.6/mods-available
$ phpenmod raphf
Note that you might need sudo for these commands.
Similarly, for propro-1.0.2
$ pecl install raphf-1.0.2
$ echo "extension=raphf.so" >> /etc/php/5.6/mods-available
$ phpenmod raphf
If you use php -m to view all the loaded extensions, you should see raphf and propro in the list.
Now you can install pecl_http-2.6.0 with
$ pecl install pecl_http-2.6.0
The installation should complete successfully.
$ pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
pecl_http 2.6.0 stable
propro 1.0.2 stable
raphf 1.1.2 stable
If you are using pecl like me, you might see warning such as:
install ok: channel://pecl.php.net/pecl_http-2.6.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=http.so" to php.ini
which happens because the php_ini config of my pear and pecl aren't set.

Related

PHP Extensions activate in Ununtu

Ive installed an extension (rdkafka) to the server (ubuntu)
and added the extension to php.ini
extension=rdkafka.so
but when i go to phpinfo(), the rdkafka is not activated
when i try this command:
phpenmod rdkafka
i got this error:
WARNING: Module rdkafka ini file doesn't exist under /etc/php/7.3/mods-available
on extensions folder,, all the extensions colored green, except rdkafka is white
install PHP pecl and pear
sudo apt install php-pear
Add backports repository. Current ext-rdkafka depends on librdkafka version 0.11.0 or greater. So follow official instructions but use stretch-backports
Install librdkafka-dev package from backports:
sudo apt -t stretch-backports install librdkafka-dev
Update apt:
sudo apt update
Install PECL-package:
sudo pecl install rdkafka
Enable PHP-extension in PHP config. Add to php.ini:
extension=rdkafka.so
Restart apache
sudo apachectl -k restart

PECL install xdebug fails because it finds built-in older PHP instead of homebrew's latest version

I'm installing xdebug with pecl sudo pecl install xdebug and I get: checking Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.6.30)
I installed the latest PHP v7.2 with homebrew, but pecl finds the outdated MacOS built-in version of PHP, how can I make pecl find the latest version?
Can you try?
pecl -d php_suffix=7.2 install <package>
Also you can try to change pecl settings:
sudo pecl config-set php_ini /etc/php/7.2/cli/php.ini
sudo pecl config-set ext_dir /usr/lib/php/******/
sudo pecl config-set bin_dir /usr/bin/
sudo pecl config-set php_bin /usr/bin/php7.2
sudo pecl config-set php_suffix 7.2
And in case nothing works use the force:
sudo pecl install -f
Since other answers at current moment do not work anymore as PHP 7.x is deprecated the only workaround that is succesfull for xdebug is specifying the exact version. For example for PHP 7.4 the latest compatible Xdebug version is 3.1.6:
pecl install xdebug-3.1.6

yum install mcrypt error [duplicate]

I have been trying to install php-mcrypt for a while now. Everytime I get the "No package php-mcrypt available." returned to me. Here's what I've tried:
root#ip-********** [~]# yum install php-mcrypt --enablerepo=centosplus (<- both with and without this)
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: p3plmirror01.prod.phx3.secureserver.net
* centosplus: p3plmirror01.prod.phx3.secureserver.net
* epel: mirrors.solfo.com
* extras: p3plmirror01.prod.phx3.secureserver.net
* updates: p3plmirror01.prod.phx3.secureserver.net
centosplus | 3.5 kB 00:00
centosplus/primary_db | 746 kB 00:00
Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do
I have made sure to install the EPEL repository. At this point I'm just stumped. I've followed EVERY tutorial I've found online and get the same error.
Notes: GoDaddy VPS, CentOS 6.4 64-bit, mcrypt installed without a hitch, but no php-mcrypt.
I had the same issue, and found the previous suggestions gave me enough info to get it working on my server. The following is what I did:
1) Install EPEL repository (From: http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x):
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
2) Install it via:
yum update
yum install php-mcrypt*
The yum update updated the repository reference on my server then the 2nd command got what I needed :)
3) Restart your webserver. For my apache install I did:
service httpd restart
For me the answer was:
1) Get the Repos from
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
2) Install it via:
sudo yum update
sudo yum install php-mcrypt*
3) Edit the mcrypt.ini
sudo nano /etc/php.d/mcrypt.ini
add this
extension=/usr/lib64/php/modules/mcrypt.so
Finally
4) Restart your webserver:
sudo service httpd restart
I run this steps in CentOS 6.3 (64) on Azure From Microsoft Linux image
Hope it helps you.
Best Regards.
Updated Answer for centos 7
## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
# rpm -ivh epel-release-7-0.2.noarch.rpm
For CentOS 6
## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
Install
yum install php-mcrypt
Edit: See comments for updated repositories.
yum install php-mcrypt.x86_64
worked for me instead of
yum install php-mcrypt
I was able to figure this out; it was a lot simpler then I thought. Under the WHM manager go to: Home >> Software >> EasyApache (Apache Update) >> There you have two options "Build Profile" or "Customize Based On Profile". I went Customize to keep my current config then followed the instructions on the page.
Eventually there was a place to add and remove php modules. There you will find ever module under the sun. Just select the one you want and rebuild the profile. It was really that simple.
I got too much problem in installing php-mcrypt using epel-release-6-8.noarch.rpm. It has some dependency problem.
Then I tried in different way.
Get the php-mcrypt using "wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm" command.
Then install libmcrypt
ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm
The installed php-mcrypt using following command
yum install php-mcrypt-5.3.3-3.el6.x86_64.rpm
If php_mcrypt installed on 64bit but reported missing by an installer, check the extension path:
vi /etc/php.d/mcrypt.ini
; Enable mcrypt extension module
;extension=module.so
extension=/usr/lib64/php/modules/mcrypt.so
To install mcrypt from http://namhuy.net/641/centos-6-install-mcrypt-for-phpmyadmin.html
i386
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
x86_64
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
then just use yum command to install the mcrypt package
yum install php-mcrypt
The best way is to:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm
yum localinstall php-mcrypt-5.3.3-3.el6.x86_64.rpm
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm
yum localinstall libmcrypt-2.5.8-9.el6.x86_64.rpm
or go to: http://dl.fedoraproject.org/pub/epel/6/x86_64/ to match your version
check from your info.php that is ok -- done!
There are two ways you can address this:
Download php-mcrypt from fedora:
http://injustfiveminutes.wordpress.com/2012/11/23/install-php-mcrypt-extension-on-rhel-6/
Check if you're facing a known bug with a wrongly packaged php-mcrypt extension:
http://www.sterndata.com/blog/phymyadmin-mcrypt-and-centos-6-mcrypt-extension-missing-solved
For me I had to add the EPEL repository. It is where my php-mcrypt came from:
[root#system ~]$ repoquery -i php-mcrypt
Name : php-mcrypt
Version : 5.3.3
Release : 1.el6
Architecture: i686
Size : 39225
Packager : Fedora Project
Group : Development/Languages
URL : http://www.php.net/
Repository : epel <----------
Summary : Standard PHP module provides mcrypt library support
Source : php-extras-5.3.3-1.el6.src.rpm
Description :
Standard PHP module provides mcrypt library support
You can enable the EPEL repo with the instructions here:
http://fedoraproject.org/wiki/EPEL
installing php-mcrypt from Repoforge worked for me perfectly. Just add Repoforge from http://repoforge.org/ and simply run yum install php-mcrypt.
For me, this worked :
yum install php-mcrypt*
and then, restart httpd service
service httpd restart
I tryed #VenomFangs solution but the first step was not needed for me. I already had a newer EPEL version installed. So, the first step following was not usefull, I backed to the snapshot I did before doing modifications and I just used the install and restart above commands.
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
CentOS Linux release 7.2.1511 (Core)
PS : I know this is not the subject, but if somebody needs it, the keyword can help. I needed to do this because of this error on prestashop. Two keywords I would be glad to use to find this informations are : "php_mycrypt.dll" "php_mcrypt.dll"
Fatal error: Call to undefined function mcrypt_encrypt() in /classes/Rijndael.php on line 46
EDIT 10/06/2016 :
Another Prestashop solution to try in "Advanced Parameters", "Performance", "Ciphering" (FR : Chiffrement), "Use the custom BlowFish class." instead of "Use Rijndael with mcrypt lib. (you must install the Mcrypt extension)."
First find out your PHP version. In my case 5.6.
php --version
PHP 5.6.27 (cli) (built: Oct 15 2016 21:31:59)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Then:
sudo yum search mcrypt
And choose the best one for your version from the list, I used php56w-mcrypt.
$ sudo yum search mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
..... output truncated ....
libmcrypt-devel.i686 : Development libraries and headers for libmcrypt
libmcrypt-devel.x86_64 : Development libraries and headers for libmcrypt
libtomcrypt-devel.i686 : Development files for libtomcrypt
libtomcrypt-devel.x86_64 : Development files for libtomcrypt
libtomcrypt-doc.noarch : Documentation files for libtomcrypt
php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php55w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
# either of these are fine:
php56-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php56w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php70-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php70w-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
php71-php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support
libmcrypt.i686 : Encryption algorithms library
libmcrypt.x86_64 : Encryption algorithms library
libtomcrypt.i686 : A comprehensive, portable cryptographic toolkit
libtomcrypt.x86_64 : A comprehensive, portable cryptographic toolkit
mcrypt.x86_64 : Replacement for crypt()
```
Finally:
sudo service httpd restart
I was having same issue in centos 6.5
Finaly solution below worked for me
-go to http://dl.fedoraproject.org/pub/epel/6/x86_64/
-search for php-mcrypt(http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm)
-execute wget http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm
-rpm -ivh php-mcrypt-5.3.3-3.el6.x86_64.rpm
if there are any dependencies you can download same using http://dl.fedoraproject.org/pub/epel/6/x86_64/
For php 7 to install mcrypt run:
Centos:
sudo yum install php7.0-mcrypt to install
On Ubuntu:
sudo apt-get install php7.0-mcrypt
If you want to recompile PHP with mcrypt enable.
1.
Insatll mcrypt. libmcrypt-devel is from Third Party Repositories EPEL, so you should:
yum --enablerepo=extras install epel-release
yum install libmcrypt-devel
2.
Append --with-mcrypt to your ./configure arguments:
./configure --with-mcrypt
3.
Build and install:
make & make install
Try
yum clean all
yum remove epel-release
yum install epel-release
and finally
yum install php-mcrypt

How to install php extension using pecl for specific php version, when several php versions installed in system?

I have installed both php5.6 and php7.0 from PPA on Ubuntu according to this manual
http://lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu
But I didn't get how to install extensions using pecl for php5.6 or php7.0.
For example I have already installed version of libevent or amqp in php5.6.
Now when I type pecl install libevent and my active php version is php7.0 (using update-alternatives --set php /usr/bin/php7.0),peclreturns message thatlibevent` already installed.
But it was installed only for php5.6 (when this version was active) and now I want to do it for php7.0.
Which commands could help me?
UPD
I have found this commands for switch pecl to php7.0 and packet them to executable bash scripts:
#!/bin/bash
sudo update-alternatives --set php /usr/bin/php7.0
sudo pecl config-set php_ini /etc/php/7.0/cli/php.ini
sudo pecl config-set ext_dir /usr/lib/php/20151012/
sudo pecl config-set bin_dir /usr/bin/
sudo pecl config-set php_bin /usr/bin/php7.0
sudo pecl config-set php_suffix 7.0
and for php5.6
#!/bin/bash
sudo update-alternatives --set php /usr/bin/php5.6
sudo pecl config-set php_ini /etc/php/5.6/cli/php.ini
sudo pecl config-set ext_dir /usr/lib/php/20131226/
sudo pecl config-set bin_dir /usr/bin/
sudo pecl config-set php_bin /usr/bin/php5.6
sudo pecl config-set php_suffix 5.6
But they are not help, pecl still gives me list of already installed extensions to php5.6, even if I switched to php7.
pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
amqp 1.7.1 stable
libevent 0.1.0 beta
stats 1.0.3 stable
It should be empty for php7.0 !
How to solve the problem?
UPD
For amqp I have just installed php-amqp package without using pecl.
apt-get install php-amqp
And libevent still not exists for php7.
But I hadn't found a way to switch pecl installation between 5.6 and 7 version, so question is still open.
Here's what worked best for me when trying to script this (in case anyone else comes across this like I did):
$ pecl -d php_suffix=5.6 install <package>
$ pecl uninstall -r <package>
$ pecl -d php_suffix=7.0 install <package>
$ pecl uninstall -r <package>
$ pecl -d php_suffix=7.1 install <package>
$ pecl uninstall -r <package>
The -d php_suffix=<version> piece allows you to set config values at run time vs pre-setting them with pecl config-set. The uninstall -r bit does not actually uninstall it (from the docs):
vagrant#homestead:~$ pecl help uninstall
pecl uninstall [options] [channel/]<package> ...
Uninstalls one or more PEAR packages. More than one package may be
specified at once. Prefix with channel name to uninstall from a
channel not in your default channel (pecl.php.net)
Options:
...
-r, --register-only
do not remove files, only register the packages as not installed
...
The uninstall line is necessary otherwise installing it will remove any previously installed version, even if it was for a different PHP version (ex: Installing an extension for PHP 7.0 would remove the 5.6 version if the package was still registered as installed).
When pecl throws error is already installed and is the same as the released version
Switch to required php, php-config, phpize versions before installing from pecl
Just run it installation with force flag
sudo pecl install -f <package-name>
I ran into this same issue while updating my Vagrant box with XHGui, as XHGui requires mongodb. I wanted to be able to support profiling on both PHP 5.6 and 7.0.
I dug into the pecl source code, and found that there's a metadata_dir config option. That is a path to a directory where the current state of installed packages. Unfortunately, that isn't already namespaced per PHP version. If you try and set it with pecl config-set, you get an opaque 'failed' error. It turns out that setting isn't whitelisted as being configuable in the \PEAR_Config class:
/**
* Configuration values that can be set for a channel
*
* All other configuration values can only have a global value
* #var array
* #access private
*/
var $_channelConfigInfo = array(
'php_dir', 'ext_dir', 'doc_dir', 'bin_dir', 'data_dir', 'cfg_dir',
'test_dir', 'www_dir', 'php_bin', 'php_prefix', 'php_suffix', 'username',
'password', 'verbose', 'preferred_state', 'umask', 'preferred_mirror', 'php_ini'
);
In PECL's world, 'global' means it can only be set at install time, and not after.
There's an issue in the PPA tracker over at github: https://github.com/oerdnj/deb.sury.org/issues/407
The final suggestion there is to build the extension manually for alternate PHP versions. I ended up using pecl for PHP 7 extensions, and manual builds for 5.6. Make sure you run update-alternatives for php-config and phpize, and not just php before building:
update-alternatives --set php /usr/bin/php5.6
update-alternatives --set php-config /usr/bin/php-config5.6
update-alternatives --set phpize /usr/bin/phpize5.6
Then, extract the extension and build it. These steps from the above issue worked for me with the mongodb extension:
phpize5.6 && ./configure --with-php-config=php-config5.6 && make && sudo make install
First of all, get admin permission in Linux Environment-
**Sudo su **
<>
Then follow below syntax
sudo apt-get install php7.3-bcmath
Here php7.3 (Enter your php version and check by php -v)
bcmath (Enter your extension name)
And if you want to check list of active extensions enter (php -m) in terminal.

struggling to install PHP pecl on Centos

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
On CentOS,
Install PHP Pear if not installed yet:
# yum install php-pear
Install GCC if not installed yet:
# yum install gcc
Install cURL if not installed yet:
# yum install curl-devel
Install following libraries if not installed yet:
# yum install php-devel
# yum install zlib-devel
# yum install pcre-devel
Start the main installation:
# pecl install pecl_http
Add the following line to /etc/php.ini file
extension=raphf.so
extension=propro.so
extension=http.so
Restart apache server so the extension can be loaded
# service httpd restart
You can check if it installed successfully or not:
# pecl list
Step 1) import the REMI repo
CentOS 5
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm;
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm;
CentOS 6
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm;
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm;
Step 2) install php-pear
yum --enablerepo=remi,remi-php55 install php-pear
Step 3) install pecl_http
pecl install pecl_http
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 the exclude 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 the exclude directive.
if you are running php 7 you might want to try this
yum install php70w-pear
if you get any errors, be sure to uninstall the pear package from any previous attempts
yum remove php-pear
best of luck
If you are using php 5.4.x, IMO best repo to use is iuscommunity. Its very stable and used by Rackspace to do only PHP and a few other packages for CentOS.
rpm -Uhv http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm
yum install php54-pear
Mind you, the reason why its php54-pear and not php-pear is because 5.3 and 5.4 both are compiled in the repository. Here is the list of php packages -> http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/repoview/development.languages.group.html
I tested this and it works, but I only use EPEL and iuscommunity REPO's. I avoid using rpmforge myself.
Centos 6.5 and php7:
sudo su -
yum install yum-utils
you can get last version of lua : http://pecl.php.net/package/lua
wget http://pecl.php.net/get/lua-2.0.4.tgz
tar -xvzf lua-2.0.4.tgz
cd lua-2.0.4
mkdir /usr/include/lua
mv * /usr/include/lua
yum install gcc
yum install php70w-pearl php70w-devel
yum install curl-devel
yum install zlib-devel
yum install pcre-devel
ln -s /usr/include/lua.h /usr/include/lua/lua.h
rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm
yum-config-manager --enable remi-php70
yum update
yum --enablerepo=remi,remi-php70 install php70w-pear
yum install lua-devel lua-static
pecl install lua-2.0.4
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
yum install php-pecl-http
yum install php-pecl-lua
etc
And, don't forget to read the Wizard instructions
I tried almost everything on this list before I finally realized that my WHM/cPanel installation was blocking the yum packages. I have to install all PECL modules (I was stuck trying to install mongodb on this particular occation) through the Home > Software > Module Installers inside WHM (cpanel documentation says that you have to be logged in as root).
After watching a lot of threads and installing pear and all the devtool, I finally solved it installing this extension:
yum install php-pecl-mongo
as I seen in - https://madcoda.com/2012/12/install-mongodb-php-driver-in-centos-6-3/

Categories