64-bit system compiled PHP cannot find the library file problem
Recently, when compiling 5.4.5 PHP on 64-bit systems, I encountered the following error:
Checking for Dsa_get_default_method In-lssl ... yeschecking for x509_free in-lcrypto ... yeschecking for pkg-config .../us R/bin/pkg-configconfigure:error:cannot Find OpenSSL ' s libraries
The specified compilation parameters:
./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
OpenSSL can not find the library file, but I clearly have installed Openssl-devel, very strange, online search, found a lot of friends, met the same problem, some people said--with-openssl do not specify the path to solve, tried a bit, indeed compiled through, but do not want to pass , why? Later, searching for some articles, finally find out the root cause of the problem: the installation of the system is 64-bit, and 64-bit user library file by default is in/usr/lib64, and I compile, do not specify--WITH-LIBDIR=LIB64, and the compiler script default is LIB, This is of course not found.
Change the compilation parameter to:
./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
Problem solving.