php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55108 Unable to compile with MySQL
Submitted: 2011-07-01 15:04 UTC Modified: 2013-10-01 12:34 UTC
Votes:8
Avg. Score:4.6 ± 0.5
Reproduced:8 of 8 (100.0%)
Same Version:2 (25.0%)
Same OS:4 (50.0%)
From: s21122012 at yahoo dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.4.0alpha1 OS: Mac OS X 10.6.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: s21122012 at yahoo dot com
New email:
PHP Version: OS:

 

 [2011-07-01 15:04 UTC] s21122012 at yahoo dot com
Description:
------------
I'm trying to compile PHP 5.4 alpha 1 with MySQL support using the configuration 
commands in "Version 1". It produces the error below. If I use "Version 2" (that 
is, no MySQL), it works.

MySQL is 5.5.13 x86_64.

Test script:
---------------
Version 1
----------
./configure --prefix=/alt --with-apxs2=/alt/apache/bin/apxs --with-openssl=/alt --with-zlib=/alt --with-curl=/alt --with-gmp=/alt --with-libxml-dir=/alt --enable-ftp --disable-cgi --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config

Version 2
----------
./configure --prefix=/alt --with-apxs2=/alt/apache/bin/apxs --with-openssl=/alt --with-zlib=/alt --with-curl=/alt --with-gmp=/alt --with-libxml-dir=/alt --enable-ftp --disable-cgi

Expected result:
----------------
Build complete

Actual result:
--------------
Undefined symbols for architecture x86_64:
  "_res_9_init", referenced from:
      _zif_dns_get_mx in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_check_record in dns.o
  "_res_9_search", referenced from:
      _zif_dns_get_mx in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_check_record in dns.o
  "_res_9_dn_skipname", referenced from:
      _zif_dns_get_mx in dns.o
      _zif_dns_get_record in dns.o
  "_res_9_dn_expand", referenced from:
      _zif_dns_get_mx in dns.o
      _php_parserr in dns.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-01 16:22 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2011-07-01 16:22 UTC] johannes@php.net
These might be caused by conflicts in the usage of either HAVE_DNS_SEARCH or HAVE_RES_NSEARCH between MySQL libs and PHP. Did you use MySQL binary packages or did you compile MySQL yourself?
I have no Mac at hand, could you please send me the file main/php_config.h from the failing build? - Thanks.

(As remark: You could build PHP using mysqlnd instead of libmysql by using --with-mysql=mysqlnd --with-mysqli=mysqlnd - but your issue should be fixed anyways.)
 [2011-07-01 18:12 UTC] s21122012 at yahoo dot com
-Status: Feedback +Status: Open
 [2011-07-01 18:12 UTC] s21122012 at yahoo dot com
Thank you for your reply!

I used the binary package when I posted the issue, but I had tried with a 
version compiled by myself before and the result was the same. Here is the file 
you requested (it was compiled using only the --prefix, --with-apxs2, --with-
mysql and --with-mysqli flags): http://dl.dropbox.com/u/4460937/php_config.h

I have been able to compile it with MySQL support using the native driver 
(mysqlnd), as suggested by you.

I would also like to mention that I had similar errors with PHP 5.3.6 in the 
past. I am not sure if the conflict was between the same macros, though.
 [2011-08-29 23:10 UTC] aaronh at bind dot com
Same issue here running Lion Server / 10.7.1 and php-5.3.8 with the mysql 
binary.

mysql-5.5.15-osx10.6-x86_64.tar.gz

Darwin 6c1.sjc.6connect.com 11.0.1 Darwin Kernel Version 11.0.1: Thu Jul 28 
02:01:39 PDT 2011; root:xnu-1699.23.4~1/RELEASE_X86_64 x86_64

Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure -
-disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --
mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- -
-program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --
build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-
2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-
darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-
include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
 [2011-09-01 22:30 UTC] matt dot fellows at onegeek dot com dot au
I had the same issue with php 5.3.8 on Lion, but unfortunately I'm unable to use the mysqlnd option due to the fact that the database I'm connecting to is MySQL v3.

Assuming a default MySQL installation (5.5.15 using either image or source), I was able to solve the issue with the following command:

sudo install_name_tool -id /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.dylib

Hope this helps someone.

Cheers,
Matt
 [2011-11-07 20:09 UTC] rpickard at gmail dot com
Hi all,

I had this problem trying to compile php 5.3.8 on OS X 10.7.2 (Lion) with MySQL 
5.5.17 against Apache 2.2.21. I found a solution that would allow the build to 
complete here:

https://github.com/adamv/homebrew-alt/issues/53

The solution is to set a EXTRA_CFLAGS value of -lresolv. In my case with the bash 
command

export EXTRA_CFLAGS=-lresolv

and then re-do make. There was no need to do make clean or distclean.

After compiling all tests passed.

Hope this helps,
-p.
 [2013-10-01 12:34 UTC] mike@php.net
-Status: Open +Status: Not a bug
 [2013-10-01 12:34 UTC] mike@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 10:01:24 2019 UTC