Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing php mongo driver after php5 upgrade

I upgraded my php5 version from 5.4 to 5.6 this way (debian 7.9) :

I added

deb http://packages.dotdeb.org wheezy-php56 all
deb-src http://packages.dotdeb.org wheezy-php56 all

to my /etc/apt/source.list file, and then :

apt-get update
apt-get install php5

All is running fine :

php --version
PHP 5.6.16-1

But i need to upgrade my php mongodb driver, and i got the following error :

pecl install mongodb 

331 source files, building
running: phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
building in /tmp/pear/temp/pear-build-rootmStnQj/mongodb-1.0.0
running: /tmp/pear/temp/mongodb/configure --with-php-config=/usr/bin/php-config
[...]
checking for pkg-config... no
configure: error: Cannot find OpenSSL's libraries
ERROR: `/tmp/pear/temp/mongodb/configure --with-php-config=/usr/bin/php-config' failed

I have openssl and libssl-dev installed. Any idea ?

like image 497
user2733521 Avatar asked Dec 04 '15 10:12

user2733521


2 Answers

I had same problem and following command worked for me.

apt-get install pkg-config
like image 163
jakub.josef Avatar answered Nov 11 '22 12:11

jakub.josef


I had the same error. I installed the following dependencies before installing mongodb

sudo apt-get install -y autoconf g++ make openssl libssl-dev libcurl4-openssl-dev pkg-config libsasl2-dev libpcre3-dev
sudo pecl install mongodb
like image 44
Jeetendra Pujari Avatar answered Nov 11 '22 14:11

Jeetendra Pujari