php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47715 apache link failed: undefined reference to `mysql_server_init'
Submitted: 2009-03-19 11:09 UTC Modified: 2009-03-19 13:26 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cyrille37 at gmail dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
 [2009-03-19 11:09 UTC] cyrille37 at gmail dot com
Description:
------------
While I try to make Apache1.3.41 and Php5.2.9 a error occured.
Php compilation works fine.
Apache compilation fails a link time :
php_mysql.c:405: undefined reference to `mysql_server_init'
php_mysql.c:426: undefined reference to `mysql_server_end'
php_mysql.c:1120: undefined reference to `mysql_set_character_set'


Reproduce code:
---------------
I've only got 'configure' options that I could send you if you need.

Expected result:
----------------
Successed compilation of Apache.

Actual result:
--------------
Apache compilation fail :
...
<=== src/modules
gcc -c  -I./os/unix -I./include   -DLINUX=22 -DHAVE_SET_DUMPABLE -I/usr/include/db1 -DMOD_SSL=208131 -DEAPI -DNO_DL_NEEDED `./apaci` modules.c
gcc -c  -I./os/unix -I./include   -DLINUX=22 -DHAVE_SET_DUMPABLE -I/usr/include/db1 -DMOD_SSL=208131 -DEAPI -DNO_DL_NEEDED `./apaci` buildmark.c
gcc  -DLINUX=22 -DHAVE_SET_DUMPABLE -I/usr/include/db1 -DMOD_SSL=208131 -DEAPI -DNO_DL_NEEDED `./apaci` -L/usr/lib   \
      -o httpd buildmark.o modules.o modules/standard/libstandard.a modules/ssl/libssl.a modules/php5/libphp5.a main/libmain.a ./os/unix/libos.a ap/libap.a    -Wl,-rpath,/usr/local/lib -Wl,-rpath,/home/mysql/lib  -rdynamic -L/usr/local/lib -L/home/mysql/lib -Lmodules/php5 -L../modules/php5 -L../../modules/php5 -lmodphp5    -rdynamic -L/usr/local/lib -L/home/mysql/lib -lcrypt   -lexslt -lcrypt -lrt -lmysqlclient -lmcrypt -lltdl -lpng -lz -ljpeg -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -lcrypt   -lm -lcrypt -lndbm  -lssl -lcrypto -lexpat
modules/php5/libphp5.a(php_mysql.o): In function `zm_startup_mysql':
/usr/local/src/php-5.2.9/ext/mysql/php_mysql.c:405: undefined reference to `mysql_server_init'
modules/php5/libphp5.a(php_mysql.o): In function `zm_shutdown_mysql':
/usr/local/src/php-5.2.9/ext/mysql/php_mysql.c:426: undefined reference to `mysql_server_end'
modules/php5/libphp5.a(php_mysql.o): In function `zif_mysql_set_charset':
/usr/local/src/php-5.2.9/ext/mysql/php_mysql.c:1120: undefined reference to `mysql_set_character_set'
collect2: ld returned 1 exit status


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-19 11:15 UTC] cyrille37 at gmail dot com
I forgot to tell the Mysql version : 5.0.26

/home/mysql/bin/mysqld  Ver 5.0.26-standard-log for pc-linux-gnu on i686 (MySQL Community Edition - Standard (GPL))
 [2009-03-19 12:18 UTC] scottmac@php.net
Sounds like you're compiling and linking against different versions of MySQL.

Is there a system MySQL in /usr/lib from an older version?
 [2009-03-19 13:14 UTC] cyrille37 at gmail dot com
Yes there is an older version in /usr/lib/mysql.
But my php's configure options use the /home/mysql path :

./configure  \
  --prefix=/usr/local/php5 \
  --with-apache=/usr/local/src/apache_1.3.41 \
  --with-mysql=/home/mysql \
  ...

Perhaps I had to tell apache link phase to use the same path.
In this case I do not know how to do ...
 [2009-03-19 13:26 UTC] cyrille37 at gmail dot com
Ok, thanks you Scott.

I've deleted all mysql* and libmysql* files in /usr/lib and /usr/include.
Then relauched the build.
And SUCCESS !

I close the bug, it's not one.

Best regards
Cyrille.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 17:01:26 2019 UTC