Differences

This shows you the differences between two versions of the page.

Link to this comparison view

server-administration:building-php-with-mysql-on-centos-5-64bit [2010-02-08 15:02:07]
garrett.plasky created
server-administration:building-php-with-mysql-on-centos-5-64bit [2010-06-22 16:10:59] (current)
garrett.plasky
Line 1: Line 1:
 ====== Compiling PHP on CentOS 5 (64bit) with MySQL Support ====== ====== Compiling PHP on CentOS 5 (64bit) with MySQL Support ======
  
-If you try to build PHP 5.x.x on a 64bit CentOS install you may get this error: +Moved to the [[:apache:building-php-with-mysql-on-centos-5-64bit|new Apache category]].
- +
-<code console>​ +
-checking for specified location of the MySQL UNIX socket... no +
-checking for MySQL UNIX socket location... /​var/​lib/​mysql/​mysql.sock +
-checking for mysql_close in -lmysqlclient... no +
-checking for mysql_error in -lmysqlclient... no +
-configureerrormysql configure failed. Please check config.log for more information. +
-</​code>​ +
- +
-Looking further into the config.log you will also see: +
- +
-<code console>​ +
-configure:​60376:​ checking for mysql_error in -lmysqlclient +
-configure:​60395:​ gcc -o conftest ​-I/​usr/​include -g -O2  -Wl,​-rpath,/​usr/​lib/​mysql -L/​usr/​lib/​mysql ​-L/​usr/​lib  ​-Wl,​-rpath,/​usr/​kerberos/​lib64 -L/​usr/​kerberos/​lib64 -Wl,​-rpath,/​usr -L/usr conftest.c -lmysqlclient ​ -lz -lpng -lz -lcurl -lz -lrt -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm 1>&5 +
-/​usr/​bin/​ld:​ skipping incompatible /​usr/​lib/​mysql/​libmysqlclient.so when searching for -lmysqlclient +
-/​usr/​bin/​ld:​ skipping incompatible /​usr/​lib/​mysql/​libmysqlclient.a when searching for -lmysqlclient +
-/​usr/​bin/​ld:​ cannot find -lmysqlclient +
-collect2: ld returned 1 exit status +
-</​code>​ +
- +
-First things first, if you installed MySQL using yum you should make sure that you have the mysql-devel rpms installed. ​ You can ensure they are installed by running the following command: +
- +
-<code console>​ +
-# yum install mysql-devel +
-</​code>​ +
- +
-Once you've ensured that the mysql-devel rpms are installed you need to tell PHP where it should also look for additional libraries. We will pass the following to the configure script: +
- +
-<code console>​ +
-# ./configure --with-libdir=lib64 --with-mysql +
-</​code>​ +
- +
-That's it, from there you can continue on with the normal build. +
- +
-{{tag>​apache centos how-to mysql php}}+