note: php compiler

2014051314:32

CentOS

php configure時出現:

checking for cURL support... yes
checking if we should use cURL for url streams... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/


解決:

# yum -y install curl-devel


 

checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found.


解決:

# yum install libpng-devel libjpeg-devel   ( jpg/png 都裝)


 

checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.


解決:

configure 加上 -with-xpm-dir=/usr



If configure fails try --with-vpx-dir=<DIR>
checking for png_write_image in -lpng... yes
configure: error: libXpm.(a|so) not found.


解決:

# yum install libXpm-devel

configure 加上 --with-libdir=lib64


 

configure: error: freetype-config not found.


解決:

# yum install freetype-devel


checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.


ref
http://stackoverflow.com/questions/17109818/install-php-mcrypt-on-centos-6


checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!


When configuring PHP for x86_64, it is necessary to use:
--with-libdir=lib64

When you compile MySQL from source, it does not place its files in lib64, but rather lib.

Here in my case i have configured MySQL using:
--prefix=/usr/local/mysql

When you entered the /usr/local/mysql directory, you can find 'lib' in there, but in the 64 bit os, PHP compilation forced to check for 'lib64' directory in mysql home directory to compile php with mysql.



解決:

# cd /usr/local/mysql
# ln -s lib lib64


ref
http://www.sudosu.in/2013/04/error-cannot-find-libmysqlclientr-under.html


/usr/bin/ld: /usr/local/mysql/lib/mysql/libmysqlclient.a(libmysql.o): relocation R_X86_64_32 against `.data' can not be used when
making a shared object; recompile with -fPIC
/usr/local/mysql/lib/mysql/libmysqlclient.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1


# cd /usr/local/mysql
# mv lib lib.bak
# ln -s /usr/lib64/mysql /usr/local/mysql/lib

checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.


# yum install mysql-devel mysql