Recently when i compiled the php 5.4.5 in my 64 bit operating system,it appeared the following errors:

1.checking for DSA_get_default_method in -lssl... yes  
2.checking for X509_free in -lcrypto... yes  
3.checking for pkg-config... /usr/bin/pkg-config  
4.configure: error: Cannot find OpenSSL's libraries 

There are my specified parameters of the compiler:

1./configure \
2.--prefix=/usr/local/services/php-5.4.5 \
3.--with-config-file-path=/usr/local/services/php-5.4.5/etc \
4.--enable-fpm \
5.--enable-mbstring \
6.--enable-soap \
7.--enable-sockets \
8.--enable-zip \
9.--with-curl=/usr \
10.--with-mysql=mysqlnd \
11.--with-mysqli=mysqlnd \
12.--with-pdo-mysql=mysqlnd \
13.--with-gd \
14.--with-jpeg-dir=/usr \
15.--with-png-dir=/usr \
16.--with-zlib-dir=/usr \
17.--with-freetype-dir=/usr \
18.--with-openssl=/usr

The openssl library file can not be found, but I have installed the openssl-devel,it is so strange。I searched this problem on google,i found many people had encountered this errors.And i found the way to solve this problem. Do not specify the --with-openssl path can solve this problem.i tried to compile it and the compilation passed.

But why it happened ?I can not understand.Then i have found great deal of information.Finally i have found the source of the problem.My operating system is 64 bit,the default library files path is /usr/lib64.I do not specify the path --with-libdir=lib64 when i compiling the PHP.And the compiler would find the library files in /usr/lib,it caused this problem.Now we change the  parameters as:

1./configure \
2.--prefix=/usr/local/services/php-5.4.5 \
3.--with-config-file-path=/usr/local/services/php-5.4.5/etc \
4.--enable-fpm \
5.--enable-mbstring \
6.--enable-soap \
7.--enable-sockets \
8.--enable-zip \
9.--with-curl=/usr \
10.--with-mysql=mysqlnd \
11.--with-mysqli=mysqlnd \
12.--with-pdo-mysql=mysqlnd \
13.--with-gd \
14.--with-jpeg-dir=/usr \
15.--with-png-dir=/usr \
16.--with-zlib-dir=/usr \
17.--with-freetype-dir=/usr \
18.--with-openssl=/usr
19. --with-libdir=lib64

The problem was solved.



This address is http://www.computerites.com/internet-skills/2013/01/how-to-fix-can-not-find-the-openssl-library-files-to-compile-php-in-64-bit-operating-system-676.html