Home Backend Development PHP Tutorial 64位系统上编译PHP找不到库文件有关问题

64位系统上编译PHP找不到库文件有关问题

Jun 13, 2016 am 10:36 AM
enable openssl usr with

64位系统下编译PHP找不到库文件问题

最近在64位系统上编译5.4.5版的PHP时,遇到报以下错:

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
Copy after login

指定的编译参数:

./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
Copy after login

找不到openssl的库文件,但我明明有安装openssl-devel的,很奇怪,网上搜了一下,发现有很多朋友,遇到了同样的问题,有些人说--with-openssl不指定路径可解决,尝试了一下,的确编译通过了,但想不通,Why?后来,又搜了一些文章来看,终于找出问题的根源:安装的系统是64位的,而64位的用户库文件默认是在/usr/lib64,而我编译的时候,没有指定--with-libdir=lib64,而编译脚本默认是lib,这当然是找不到的。

将编译参数更改为:

./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
Copy after login

问题解决。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How Nginx uses the OpenSSL library for more secure communication How Nginx uses the OpenSSL library for more secure communication Jun 10, 2023 pm 01:51 PM

How Nginx uses the OpenSSL library for more secure communication

What does enable mean in computer What does enable mean in computer Aug 30, 2023 pm 01:55 PM

What does enable mean in computer

How to generate a MySQL SSL certificate using OpenSSL How to generate a MySQL SSL certificate using OpenSSL Sep 09, 2023 pm 02:12 PM

How to generate a MySQL SSL certificate using OpenSSL

OpenBLAS installation under CentOS 7 and CentOS 7 OpenSSL installation OpenBLAS installation under CentOS 7 and CentOS 7 OpenSSL installation Feb 10, 2024 am 11:45 AM

OpenBLAS installation under CentOS 7 and CentOS 7 OpenSSL installation

Demystifying the with keyword in Python Demystifying the with keyword in Python Apr 14, 2023 am 11:31 AM

Demystifying the with keyword in Python

Ubuntu system uses vsftpd to build FTP server. Ubuntu system uses vsftpd to build FTP server. Feb 18, 2024 pm 05:50 PM

Ubuntu system uses vsftpd to build FTP server.

How to perform encryption and decryption in OpenSSL basics How to perform encryption and decryption in OpenSSL basics May 22, 2023 am 09:20 AM

How to perform encryption and decryption in OpenSSL basics

Crypto library in PHP8.0: OpenSSL Crypto library in PHP8.0: OpenSSL May 14, 2023 am 08:52 AM

Crypto library in PHP8.0: OpenSSL

See all articles