64-bit system compiling PHP can not find the library file problem in 64-bit system recently compiled 5.4.5 version of PHP, encountered the following error: checkingforDSA_get_default_methodin-lssl... yescheckingforX509_freein-lcrypto... yescheckingforpkg-config... the library file cannot be found when PHP is compiled in a 64-bit usrbi system.
When I recently compiled PHP version 5.4.5 on a 64-bit system, the following error was reported:
checking for DSA_get_default_method in -lssl... yeschecking for X509_free in -lcrypto... yeschecking for pkg-config... /usr/bin/pkg-configconfigure: error: Cannot find OpenSSL's libraries
The specified compilation parameters are as follows:
./configure \--prefix=/usr/local/services/php-5.4.5 \--with-config-file-path=/usr/local/services/php-5.4.5/etc \--enable-fpm \--enable-mbstring \--enable-soap \--enable-sockets \--enable-zip \--with-curl=/usr \--with-mysql=mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-gd \--with-jpeg-dir=/usr \--with-png-dir=/usr \--with-zlib-dir=/usr \--with-freetype-dir=/usr \--with-openssl=/usr
I couldn't find the openssl library file, but I obviously installed openssl-devel. it was strange that I searched the internet and found many friends who encountered the same problem, some people say that -- with-openssl can be solved without specifying a path. after a try, the compilation is successful but cannot be understood. Why? Later, I searched some articles to find out the root cause: the installed system is 64-bit, and the 64-bit user library file is/usr/lib64 by default, during compilation, -- with-libdir = lib64 is not specified, while the default compiling script is lib, which of course cannot be found.
Change the compilation parameter:
./configure \--prefix=/usr/local/services/php-5.4.5 \--with-config-file-path=/usr/local/services/php-5.4.5/etc \--enable-fpm \--enable-mbstring \--enable-soap \--enable-sockets \--enable-zip \--with-curl=/usr \--with-mysql=mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-gd \--with-jpeg-dir=/usr \--with-png-dir=/usr \--with-zlib-dir=/usr \--with-freetype-dir=/usr \--with-openssl=/usr \--with-libdir=lib64
Solve the problem.