Compiling PHP on 64-bit system cannot find library file related issues

Source: Internet
Author: User
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.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.