New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find OpenSSL's libraries when I try to install #138

Closed
pocketmax opened this Issue Nov 13, 2015 · 23 comments

Comments

Projects
None yet
@pocketmax

pocketmax commented Nov 13, 2015

sudo pecl install mongodb-beta
...
checking configuring libmongoc... ...
checking Use system libmongoc... no
checking for pkg-config... no
configure: error: Cannot find OpenSSL's libraries

I've tried with/without sudo. I've tried to just install the mongodb lib without the -beta. I have all the openssl libs and dev libs installed and it still gives me this message. I'm using ubuntu utopic

@pocketmax

This comment has been minimized.

Show comment
Hide comment
@pocketmax

pocketmax Nov 13, 2015

fixed it...

sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev

pocketmax commented Nov 13, 2015

fixed it...

sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev

@bjori

This comment has been minimized.

Show comment
Hide comment
@bjori

bjori Nov 15, 2015

Contributor

Do you know if you had libbsl-dev installed, or if installing pkg-config fixed it?

Using pkg-config is generally preferable, but the fallback should work -- but you'll need to provide:
--with-openssl-dir=/path/to/openssl

Contributor

bjori commented Nov 15, 2015

Do you know if you had libbsl-dev installed, or if installing pkg-config fixed it?

Using pkg-config is generally preferable, but the fallback should work -- but you'll need to provide:
--with-openssl-dir=/path/to/openssl

@bjori

This comment has been minimized.

Show comment
Hide comment
@bjori

bjori Nov 15, 2015

Contributor

(also "-beta" is no longer needed -- the 1.0.0-stable has been released :))

Contributor

bjori commented Nov 15, 2015

(also "-beta" is no longer needed -- the 1.0.0-stable has been released :))

@pocketmax

This comment has been minimized.

Show comment
Hide comment
@pocketmax

pocketmax Nov 15, 2015

I already had libssl-dev and pkg-config installed already. After I installed those packages, I did a normal "sudo pecl install mogodb" and it worked without a problem.

pocketmax commented Nov 15, 2015

I already had libssl-dev and pkg-config installed already. After I installed those packages, I did a normal "sudo pecl install mogodb" and it worked without a problem.

@bjori

This comment has been minimized.

Show comment
Hide comment
@bjori

bjori Nov 16, 2015

Contributor

The configure output said you were missing pkg-config

checking for pkg-config... no

Anyway, glad everything worked out. Let us know if you find any other issues!

Contributor

bjori commented Nov 16, 2015

The configure output said you were missing pkg-config

checking for pkg-config... no

Anyway, glad everything worked out. Let us know if you find any other issues!

@bjori bjori closed this Nov 16, 2015

@pocketmax

This comment has been minimized.

Show comment
Hide comment
@pocketmax

pocketmax Nov 16, 2015

ug, sorry. I was thinking of a different VM I was testing with. omg, it's the very next line BEFORE the openssl error line and I didn't notice it. Sorry, ID-10T issue.

pocketmax commented Nov 16, 2015

ug, sorry. I was thinking of a different VM I was testing with. omg, it's the very next line BEFORE the openssl error line and I didn't notice it. Sorry, ID-10T issue.

@warrenca

This comment has been minimized.

Show comment
Hide comment
@warrenca

warrenca Feb 3, 2016

I'm running in OSX and tried the following commands

$ brew reinstall pkg-config
$ brew link openssl --force
$ sudo pecl install mongodb
....
install ok: channel://pecl.php.net/mongodb-1.1.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini

warrenca commented Feb 3, 2016

I'm running in OSX and tried the following commands

$ brew reinstall pkg-config
$ brew link openssl --force
$ sudo pecl install mongodb
....
install ok: channel://pecl.php.net/mongodb-1.1.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
@necromant2005

This comment has been minimized.

Show comment
Hide comment
@necromant2005

necromant2005 Feb 16, 2016

Ubuntu 16.10
after installing:
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev

sudo pecl install mongodb
configure: error: Cannot find OpenSSL's libraries
ERROR: `/tmp/pear/temp/mongodb/configure' failed

necromant2005 commented Feb 16, 2016

Ubuntu 16.10
after installing:
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev

sudo pecl install mongodb
configure: error: Cannot find OpenSSL's libraries
ERROR: `/tmp/pear/temp/mongodb/configure' failed

@derickr

This comment has been minimized.

Show comment
Hide comment
@derickr

derickr Feb 16, 2016

Member

@necromant2005 Can you post your "config.log" somewhere (pastebin.com)? And provide a link here?

Member

derickr commented Feb 16, 2016

@necromant2005 Can you post your "config.log" somewhere (pastebin.com)? And provide a link here?

@necromant2005

This comment has been minimized.

Show comment
Hide comment
@necromant2005

necromant2005 Feb 16, 2016

I fixed the issue by installing extra libraries, the whole list
sudo apt-get install -y autoconf g++ make openssl libssl-dev libcurl4-openssl-dev
sudo apt-get install -y libcurl4-openssl-dev pkg-config
sudo apt-get install -y libsasl2-dev

necromant2005 commented Feb 16, 2016

I fixed the issue by installing extra libraries, the whole list
sudo apt-get install -y autoconf g++ make openssl libssl-dev libcurl4-openssl-dev
sudo apt-get install -y libcurl4-openssl-dev pkg-config
sudo apt-get install -y libsasl2-dev

@zakhttp

This comment has been minimized.

Show comment
Hide comment
@zakhttp

zakhttp Mar 12, 2016

@pocketmax i did the same and it worked! thanks!

zakhttp commented Mar 12, 2016

@pocketmax i did the same and it worked! thanks!

@Devidian

This comment has been minimized.

Show comment
Hide comment
@Devidian

Devidian Apr 20, 2016

@necromant2005 Thanks, worked for me on Debian 8.3 too!

Devidian commented Apr 20, 2016

@necromant2005 Thanks, worked for me on Debian 8.3 too!

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jun 1, 2016

On Ubuntu 16.04 I removed libcurl14-openssl-dev and works too

ghost commented Jun 1, 2016

On Ubuntu 16.04 I removed libcurl14-openssl-dev and works too

@ostojicmilica

This comment has been minimized.

Show comment
Hide comment
@ostojicmilica

ostojicmilica Jun 1, 2016

I am on Ubuntu 14.10 and I get same error but when I try to run everything that @necromant2005 said I get errors:

E: Package 'pkg-config' has no installation candidate
E: Unable to locate package libsasl2-dev

ostojicmilica commented Jun 1, 2016

I am on Ubuntu 14.10 and I get same error but when I try to run everything that @necromant2005 said I get errors:

E: Package 'pkg-config' has no installation candidate
E: Unable to locate package libsasl2-dev

@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Jun 1, 2016

Member

@ostojicmilica: Those look like apt-get errors. Both of those packages should certainly exist in 14.04:

If you're unable to get those installed, you may want to inquire in an Ubuntu support forum.

AFAIK, our config.m4 only relies on pkg-config for locating the system libbson or libmongoc libraries. PHP core also uses it for locating SSL libraries in PHP_SETUP_OPENSSL(); however, they fall back to searching common system paths if pkg-config is not available. For SASL, which is specific to the driver, we merely search some common system paths (i.e. pkg-config is not used).

Explicit paths for both OpenSSL and SASL may be set with the --with-openssl-dir=/path/to/ssl and --with-mongodb-sasl=/path/to/sasl options to the configure script, respectively. In that case, pkg-config would not be needed for detecting OpenSSL.

Member

jmikola commented Jun 1, 2016

@ostojicmilica: Those look like apt-get errors. Both of those packages should certainly exist in 14.04:

If you're unable to get those installed, you may want to inquire in an Ubuntu support forum.

AFAIK, our config.m4 only relies on pkg-config for locating the system libbson or libmongoc libraries. PHP core also uses it for locating SSL libraries in PHP_SETUP_OPENSSL(); however, they fall back to searching common system paths if pkg-config is not available. For SASL, which is specific to the driver, we merely search some common system paths (i.e. pkg-config is not used).

Explicit paths for both OpenSSL and SASL may be set with the --with-openssl-dir=/path/to/ssl and --with-mongodb-sasl=/path/to/sasl options to the configure script, respectively. In that case, pkg-config would not be needed for detecting OpenSSL.

@ostojicmilica

This comment has been minimized.

Show comment
Hide comment
@ostojicmilica

ostojicmilica Jun 1, 2016

Maybe the problem is because I dont use 14.04, but 14.10 Ubuntu .

And can you tell me how to find these paths? @jmikola

ostojicmilica commented Jun 1, 2016

Maybe the problem is because I dont use 14.04, but 14.10 Ubuntu .

And can you tell me how to find these paths? @jmikola

@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Jun 1, 2016

Member

And can you tell me how to find these paths?

The OpenSSL library path will contain include/openssl/evp.h within it. The SASL library path should contain include/sasl/sasl.h within it. I'm discerning this by walking through the search logic in PHP_SETUP_OPENSSL() and this extensions' config.m4 file; however, I do not have a specific answer for your environment.

Maybe the problem is because I dont use 14.04, but 14.10 Ubuntu .

My mistake for misreading your last post. The packages are still present in 14.10, though:

I should reiterate that if you are receiving the following errors:

E: Package 'pkg-config' has no installation candidate
E: Unable to locate package libsasl2-dev

...that really hints at a problem with your operating system's package manager and is likely outside the scope of this PHP extension.

Member

jmikola commented Jun 1, 2016

And can you tell me how to find these paths?

The OpenSSL library path will contain include/openssl/evp.h within it. The SASL library path should contain include/sasl/sasl.h within it. I'm discerning this by walking through the search logic in PHP_SETUP_OPENSSL() and this extensions' config.m4 file; however, I do not have a specific answer for your environment.

Maybe the problem is because I dont use 14.04, but 14.10 Ubuntu .

My mistake for misreading your last post. The packages are still present in 14.10, though:

I should reiterate that if you are receiving the following errors:

E: Package 'pkg-config' has no installation candidate
E: Unable to locate package libsasl2-dev

...that really hints at a problem with your operating system's package manager and is likely outside the scope of this PHP extension.

@zhukovra

This comment has been minimized.

Show comment
Hide comment
@zhukovra

zhukovra Sep 27, 2016

pecl install mongodb successfully builds with pkg-config and libssl-dev packages on Jessie. No additional packages like libcurl4-openssl-dev libcurl4-openssl-dev libsasl2-dev is required.

zhukovra commented Sep 27, 2016

pecl install mongodb successfully builds with pkg-config and libssl-dev packages on Jessie. No additional packages like libcurl4-openssl-dev libcurl4-openssl-dev libsasl2-dev is required.

@Syrok

This comment has been minimized.

Show comment
Hide comment
@Syrok

Syrok Oct 5, 2016

last solution:
sudo apt-get install pkg-config libssl-dev

Syrok commented Oct 5, 2016

last solution:
sudo apt-get install pkg-config libssl-dev

@nmeegama

This comment has been minimized.

Show comment
Hide comment
@nmeegama

nmeegama Mar 4, 2017

Small correction for this command (in 2nd comment ) that I came across on Ubuntu 16.04
sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev
Error : Unable to locate package clibcurl4-openssl-dev

So I tried
sudo apt-get install pkg-config libssl-dev libsslcommon2-dev
And this still worked

nmeegama commented Mar 4, 2017

Small correction for this command (in 2nd comment ) that I came across on Ubuntu 16.04
sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev
Error : Unable to locate package clibcurl4-openssl-dev

So I tried
sudo apt-get install pkg-config libssl-dev libsslcommon2-dev
And this still worked

@geoherna

This comment has been minimized.

Show comment
Hide comment
@geoherna

geoherna Sep 3, 2017

@necromant2005 solution worked perfectly for me. Thanks ! 🍻

geoherna commented Sep 3, 2017

@necromant2005 solution worked perfectly for me. Thanks ! 🍻

@berzavlu

This comment has been minimized.

Show comment
Hide comment
@berzavlu

berzavlu commented Jul 12, 2018

u r god! @necromant2005

@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Jul 13, 2018

Member

I've created PHPC-1237 so we can improve the installation notes on PHP.net to list a number of packages from #138 (comment). The current documentation is OS-agnostic, but I realize it'd be more helpful to list package names for the most common Linux distributions (e.g. Debian/Ubuntu and perhaps Fedora/CentOS).

Member

jmikola commented Jul 13, 2018

I've created PHPC-1237 so we can improve the installation notes on PHP.net to list a number of packages from #138 (comment). The current documentation is OS-agnostic, but I realize it'd be more helpful to list package names for the most common Linux distributions (e.g. Debian/Ubuntu and perhaps Fedora/CentOS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment