Description:
Configuring PHP fails when trying to configure it with MySQL 4.1.14 installed.
MySQL was installed using the disk image installer. The startup item is installed.
The PHP configure line I used was:
./configure --with-apxs --with-mysql=/usr/local/mysql --enable-cgi --with-gd --with-jpeg --with-xml --with-iodbc --enable-sockets --enable-dbx --enable-dbase --enable-trans-sid --enable-exif --enable-wddx --enable-ftp --enable-mbstring --with-iconv --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-ldap=/usr --with-kerberos=/usr --with-zlib-dir=/usr --enable-mbregex --enable-dbx --enable-sockets --with-iodbc=/usr --with-config-file-path=/etc --sysconfdir=/private/etc
which among many other things, asks for MySQL.
The revelant message the configure displays is:
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.
Config.log contains the following information pertaining to MySQL:
configure:61413: checking for mysql_close in -lmysqlclient
configure:61432: gcc -o conftest -g -O2 -no-cpp-precomp -L/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/local/lib -L/usr/local/lib conftest.c -lmysqlclient -lldap -llber -lpng -lz -lz -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 1>&5
ld: warning empty table of contents: /usr/local/mysql/lib/libmysqlclient.a (can't load from it)
ld: Undefined symbols:
_mysql_close
configure: failed program was:
#line 61421 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_close();
int main() {
mysql_close()
; return 0; }
configure:61637: checking for mysql_error in -lmysqlclient
configure:61656: gcc -o conftest -g -O2 -no-cpp-precomp -L/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/local/lib -L/usr/local/lib -L/usr -L/usr conftest.c -lmysqlclient -lz -lldap -llber -lpng -lz -lz -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 1>&5
ld: warning empty table of contents: /usr/local/mysql/lib/libmysqlclient.a (can't load from it)
ld: Undefined symbols:
_mysql_error
configure: failed program was:
#line 61645 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_error();
int main() {
mysql_error()
; return 0; }
PHP configure options also tried:
--with-mysql (resulted in a message saying the client is no longer bundled, of course)
--with-mysql-dir=/usr/local/mysql (suggested including --with-zlib-dir)
--with-mysql-dir=/usr/local/mysql --with-zlib-dir=/usr (failed with same error as long config line)
It should be noted that PHP configuring works correctly with MySQL 4.1.10 under the same conditions.
How to repeat:
1) Install MySQL (from disk image?).
2) Attempt to configure PHP using the options --with-mysql-dir=/usr/local/mysql --with-zlib-dir=/usr