php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28810 build fails on unresolved symbols mysql_create_db and mysql_
Submitted: 2004-06-17 00:54 UTC Modified: 2004-08-11 22:40 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: donp at personaltelco dot net Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.0.0RC3 OS: OS X 10.2
Private report: No CVE-ID: None
 [2004-06-17 00:54 UTC] donp at personaltelco dot net
Description:
------------
Buliding PHP5.0RC3 under OS X 10.2 and MySQL 4.0.15 fails.

This is the stock MySQL and GCC that comes with OS X 10.2.

./configure --prefix=/Users/donp/php5  --with-apxs2=/Users/donp/apache2/bin/apxs --with-mysql --with-ldap --with-libxml-dir=/sw/

(configure script completes successfully.)

make

(build progresses to the final link stage)
ld: warning multiple definitions of symbol _pcre_free
ext/pcre/pcrelib/pcre.o definition of _pcre_free in section (__DATA,__data)
/Users/donp/apache2/bin/httpd definition of _pcre_free
ld: warning multiple definitions of symbol _pcre_malloc
ext/pcre/pcrelib/pcre.o definition of _pcre_malloc in section (__DATA,__data)
/Users/donp/apache2/bin/httpd definition of _pcre_malloc
ld: warning multiple definitions of symbol _regcomp
/Users/donp/apache2/bin/httpd definition of _regcomp
/usr/lib/libpthread.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
/Users/donp/apache2/bin/httpd definition of _regexec
/usr/lib/libpthread.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
/Users/donp/apache2/bin/httpd definition of _regfree
/usr/lib/libpthread.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
_mysql_create_db
_mysql_drop_db
make: *** [libs/libphp5.bundle] Error 1


I did some research into it and it looks like those functions might have been removed from mysqlclient.a at some point. I removed the source code lines in ext/mysql/php_mysql.c|h that defined mysql_create_db and mysql_drop_db (basically the code wrapped by #ifndef NETWARE). It would then build and install but if I tried to use mysql_connect the apache thread core dumps.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-11 17:42 UTC] foo at bar dot com
Also fails with PHP 4.3.8 and MySQL 4.0.20 on Mac OS X 10.1.5, tho I don't think it's the OS. mysql_create_db() and mysql_drop_db() were deprecated some time ago and now appear dropped completely.

% nm /usr/local/mysql/lib/mysql/libmysqlclient.a |& grep mysql_create
%

http://dev.mysql.com/doc/mysql/en/mysql_create_db.html

http://dev.mysql.com/doc/mysql/en/mysql_drop_db.html
 [2004-08-11 17:54 UTC] foo at bar dot com
If you change your configuration but don't make clean, php will use the old mysql compiled extension object files, which is built against the bundled mysql 3.x library, but will try to link against your new 4.x library, causing the undefined symbols.

cd ext/mysql
rm -rf *.o *.o */*.o */*.lo
cd ..
make
 [2004-08-11 17:56 UTC] foo at bar dot com
That 2nd .o should be .lo:

rm -rf *.o *.lo */*.o */*.lo

But a whole make clean (or even make distclean) would be in order too.
 [2004-08-11 21:40 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Yup, what the foo@ guy said.
 [2004-08-11 22:40 UTC] donp at personaltelco dot net
im saying the build fails out of the box on a standard OS X 10.2 install. its not a support issue, its a build system issue. i should be able to untar, configure, and make, right? im saying that doesnt work.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC