Bug #13101 PHP cannot configure with MySQL 4.1.14 on Mac OS X
Submitted: 10 Sep 2005 8:55 Modified: 11 Oct 2005 23:50
Reporter: Bob Terrell Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.14 OS:MacOS (Mac OS X 10.4.2)
Assigned to: CPU Architecture:Any

[10 Sep 2005 8:55] Bob Terrell
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
[11 Sep 2005 23:50] Lachlan Mulcahy
Hi Bob,

I have installed 4.1.14 from the disk image packages on 10.4.2 and have tried configuring both PHP 4.4.0 and 5.0.5 using the configure line below; I had success with both.

./configure --with-mysql-dir=/usr/local/mysql --with-zlib-dir=/usr

Can you please provide some more information that may help us reproduce the problem? Perhaps it was another version of the PHP source you were configuring with?
[12 Oct 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".