php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42490 PHP will not compile with BIND 9 installed
Submitted: 2007-08-30 18:15 UTC Modified: 2007-09-18 09:18 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jerry at scene-naturally dot dyndns dot org Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.4 OS: OS X 10.4.10
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jerry at scene-naturally dot dyndns dot org
New email:
PHP Version: OS:

 

 [2007-08-30 18:15 UTC] jerry at scene-naturally dot dyndns dot org
Description:
------------
1) Compiling fails for various version of PHP 5.

It has been suggested to install BIND 8 over the BIND 9 installation, 
compile PHP and then re-install BIND 9. Not very elegant, but it might 
work if the older BIND were available.

This has become a bigger problem because BIND 8 was declared EOL as of 
August 27, (no more support either) and the links to the older 
software were removed from the ISC site.

http://www.isc.org/index.pl


2) In comparison, this next one is far more minor, but still a 
problem:

If there are multiple versions of Berkeley DB installed (say 4.1 -- 
4.6) Config picks up the older (lowered numbered) version instead o 
the newest version. The various Makefiles, etc. have to be hand-edited 
to replace the occurrences of say db-4.5 with db-4.6





Reproduce code:
---------------
Compile fails regardless of using a simple

./configure
make

or a full

./configure
options
options
...
options

make

2)

Expected result:
----------------
The usual line saying to the effect that the compile was successful and 
reminding the user to run 'make test'.

Actual result:
--------------
/usr/bin/ld: Undefined symbols:
_res_nclose
_res_ninit
_res_nmkquery
_res_nsend
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1





Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-30 20:21 UTC] jani@php.net
Where is the library located containing those symbols (can't remember what it was called :) and is the path to that library in LD_LIBRARY_PATH?
 [2007-08-30 21:22 UTC] jerry at scene-naturally dot dyndns dot org
The libraries installed by BIND 9 are

libbind9.a
libbind.a

These are in /usr/local/lib

libbind.a does seem to have the symbols, however, libbind9.a does not 
have these missing symbols.

The path /usr/local/lib IS in LD_LIBRARY_PATH


The configure app is finding either the library or the header file, 
but apparently not completely following though on that; the screen 
echo:

checking if your OS can spawn processes with inherited handles... yes
checking for res_nmkquery... no
checking for __res_nmkquery... no
checking for res_nmkquery in -lresolv... no
checking for __res_nmkquery in -lresolv... no
checking for res_nmkquery in -lbind... no
checking for __res_nmkquery in -lbind... yes
checking for res_nsend... no
checking for __res_nsend... yes
checking for dn_expand... yes

This is in the configure.log as well.


A small part of libbind.a:
 [2007-08-31 07:05 UTC] jani@php.net
You must have old libbind.* somewhere in your system which gets picked instead of the new one. Didn't you uninstall the old one before you installed the new one, apparently with different install prefix..?
 [2007-08-31 15:28 UTC] jerry at scene-naturally dot dyndns dot org
OS X does come with BIND (and it is almost ready to go out of the box) 
but it has a different set up. The libraries are

/usr/lib/libresolv.9.dylib
/usr/lib/libresolv.dylib

The header file is

/usr/include/resolv.h


Note: The Developer Tools which you install to have compilers, etc 
also has the resolv.h file.



The only libbind*.* libraries I have are from the BIND 9 installation.


Linking the older header file to the new file does not fix things.
 [2007-09-02 15:34 UTC] jerry at scene-naturally dot dyndns dot org
I have found a partial workaround, but it is very kludgy at best:


1) Turn off named. Turn off Postfix (master) and any other apps that 
are using the bind libraries. Just to be sure nothing odd happens, 
turn off the IMAP/POP servers and any of the second level apps that 
use those first level apps. Note: since these are usually started as 
LaunchDaemons or StartUpItems, you will need to disable them from re-
starting.

2) Move the libbind.a and libbind9.a libraries out of /usr/local/lib 
to the desktop (or somewhere that is not in the search path of the 
Configure app).

3) Restart the machine. This is necessary.

4) Configure, make and install the new PHP. Take care of any post 
install stuff you need to do.

5) Undo step number 2. Undo step number 1. Restart the machine.
 [2007-09-03 09:18 UTC] jani@php.net
When you start messing around with your system, the results are unexpected. This is not PHP bug per se.
 [2007-09-05 10:31 UTC] jani@php.net
Reopening, see bug #25955 

I think this must be the reason it fails on Macosx with bind 9.
Try delete the line with BIND_8_COMPAT in it from main/php_config.h after running configure and before 'make'.

 [2007-09-05 14:29 UTC] jerry at scene-naturally dot dyndns dot org
Hello Jani and thank you for taking a further look at this problem.

I tried the suggestion, but it did not work, running into a problem 
with dns. I have attached the output from running the make command.

/temp/php-5.2.4/ext/standard/dns.c: In function 'zif_dns_get_record':
/temp/php-5.2.4-copy/ext/standard/dns.c:673: error: 'HEADER' 
undeclared (first use in this function)
/temp/php-5.2.4/ext/standard/dns.c:673: error: 'hp' undeclared (first 
use in this function)
/temp/php-5.2.4/ext/standard/dns.c:674: error: parse error before 
'buf'
/temp/php-5.2.4/ext/standard/dns.c:778: error: 'QUERY' undeclared 
(first use in this function)
/temp/php-5.2.4/ext/standard/dns.c:778: error: 'C_IN' undeclared 
(first use in this function)
/temp/php-5.2.4/ext/standard/dns.c:778: error: 'buf' undeclared (first 
use in this function)
/temp/php-5.2.4/ext/standard/dns.c:786: error: 'answer' undeclared 
(first use in this function)
/temp/php-5.2.4/ext/standard/dns.c:797: error: parse error before ')' 
token
/temp/php-5.2.4/ext/standard/dns.c: In function 'zif_dns_get_mx':
/temp/php-5.2.4/ext/standard/dns.c:865: error: 'HEADER' undeclared 
(first use in this function)
/temp/php-5.2.4/ext/standard/dns.c:865: error: 'hp' undeclared (first 
use in this function)
/temp/php-5.2.4/ext/standard/dns.c:894: error: 'C_IN' undeclared 
(first use in this function)
/temp/php-5.2.4/ext/standard/dns.c:901: error: parse error before ')' 
token
make: *** [ext/standard/dns.lo] Error 1

There is an un-safe method to get this to work. Before running 
Configure, just move the libbind.a library out of /usr/local/lib and 
then run configure, which will then not put any of the dependent bind 
stuff into the various makefiles, etc.

Jerry
 [2007-09-06 10:56 UTC] jani@php.net
So you have multiple libbind.* around? AFAIK, this Macosx version comes with bind 9, so why do you have to install bind 8??? (I'm very confused  now..)

Are you able to try this with a clean system without any bind 8 libs installed and without modifying anything, using PHP 5.2.4 from fresh sources?

 [2007-09-06 14:46 UTC] jerry at scene-naturally dot dyndns dot org
No, there is only the one libbind file installed from the Bind 9 
Installation (9.4.1-p1), This is an update to the older files provided 
by Apple.

It was compiled using the --enable-libbind option for apps such as 
Postfix that need this library. This option places the libbind into 
/usr/local/lib.

This is the only libbind file on the entire system.

The older Apple setup is done differently using 
/usr/lib/libresolv.9.dylib and /usr/lib/libresolv.dylib for the 
library files.

As I have mentioned, if you remove (safely -- by shutting down all 
apps that depend on the bind libraries and then move the libbind fiel 
out of the search path or not safely by just removing the libbind 
library file out of the search path) and then running configure for 
PHP, this will allow you to build PHP. But you do not get all of the 
benefits provided by the BIND files -- as far as I can tell, the 
configure app is not not really checking the older Apple resolv 
libraries for very much.
 [2007-09-07 09:44 UTC] jani@php.net
We don't really need much from the resolv OR bind library (whichever is found) in ext/standard/dns.c so I don't think you really _need_ BIND 9 to get all the goodies out of PHP. 

Anyway, I think this is more of a header issue anyway, conflict between installed resolv.h and bind 9 header files.

Can you sent me the config.log file you get after configure?
 [2007-09-07 14:42 UTC] jerry at scene-naturally dot dyndns dot org
The log file is on its way.
 [2007-09-18 09:18 UTC] jani@php.net
Having 2 sets of header/library files which conflict with each other will never work and is not any PHP bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 15:01:35 2025 UTC