Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
apache:building-php-with-mysql-on-centos-5-64bit [2010-09-03 17:55:32]
garrett.plasky
apache:building-php-with-mysql-on-centos-5-64bit [2011-05-13 23:51:37]
garrett.plasky Approved
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 on a 64bit CentOS install you may get this error:+If you try to build PHP 5.x.x on a 64bit CentOS install you may get this error:
  
-<code console> +<sxh bash>checking for specified location of the MySQL UNIX socket... no
-checking for specified location of the MySQL UNIX socket... no+
 checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
 checking for mysql_close in -lmysqlclient... no checking for mysql_close in -lmysqlclient... no
 checking for mysql_error in -lmysqlclient... no checking for mysql_error in -lmysqlclient... no
-configure: error: mysql configure failed. Please check config.log for more information. +configure: error: mysql configure failed. Please check config.log for more information.</sxh>
-</code>+
  
 Looking further into the config.log you will also see: Looking further into the config.log you will also see:
  
-<code console>+<sxh bash>
 configure:60376: checking for mysql_error in -lmysqlclient 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 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
Line 19: Line 17:
 /usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient /usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
 /usr/bin/ld: cannot find -lmysqlclient /usr/bin/ld: cannot find -lmysqlclient
-collect2: ld returned 1 exit status +collect2: ld returned 1 exit status</sxh>
-</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: 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> +<sxh bash>yum install mysql-devel</sxh>
-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: 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:
- +<sxh bash>./configure --with-libdir=lib64 --with-mysql</sxh>
-<code console> +
-./configure --with-libdir=lib64 --with-mysql +
-</code>+
  
 That's it, from there you can continue on with the normal build. That's it, from there you can continue on with the normal build.
  
 {{tag>apache centos how-to mysql php}} {{tag>apache centos how-to mysql php}}