php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26544 Compile fails on undefined symbol "res_ninit"
Submitted: 2003-12-06 12:54 UTC Modified: 2003-12-11 06:37 UTC
From: andy at kksonline dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5CVS-2003-12-6 OS: FreeBSD 5.1 (Stable)
Private report: No CVE-ID:
 [2003-12-06 12:54 UTC] andy at kksonline dot com
Description:
------------
I tried beta2 (and newest image 2003/Dec/06). I used 

configure --with-apxs2=/path --with-pgsql=/path

I was using FreeBSD 5.1 (Stable).

ext/standard/dns.lo: In function `zif_dns_get_record':
/php5-200312061630/ext/standard/dns.c:631: undefined reference to `res_ninit'
/php5-200312061630/ext/standard/dns.c:635: undefined reference to `res_nmkquery'
/php5-200312061630/ext/standard/dns.c:641: undefined reference to `res_nsend'
/php5-200312061630/ext/standard/dns.c:675: undefined reference to `res_nclose'

If I tried another option --with-mysql, I got the same error  (in another method)

Andy



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-07 13:20 UTC] sniper@php.net
That is pretty strange since that part of the code won't be even compile if you don't have those functions..

What do you have in Makefile for EXTRA_LIBS ?

 [2003-12-08 15:45 UTC] andy at kksonline dot com
Hi !

For extra libs I have this...

EXTRA_LIBS=-lcrypt -lbind -lm -lxml2 -lz -liconv

I have Apache build totally normal (with so enabled), v2.0.44..

I usually had no problems compiling php (v3 and v4), with just this options...

Andy
 [2003-12-08 17:57 UTC] pollita@php.net
Please try changing the following line in your main/php_config.h file:

/* #undef BIND_8_COMPAT */

to

#define BIND_8_COMPAT 1

Then make and let us know the results.
 [2003-12-09 13:48 UTC] andy at kksonline dot com
Hi !
Nothing changed. Same error.
Andy
 [2003-12-09 15:37 UTC] sniper@php.net
Please put the config.log file online somewhere OR email it to me. (DO NOT paste it here!)

 [2003-12-10 10:24 UTC] sniper@php.net
Configure detects the functions with the underscore prefixes.
(e.g. __res_nmkquery in -lbind)

Please check if you have '#define HAVE_RESOLV_H 1' in main/php_config.h..also check that the /usr/include/resolv.h 
actually has the aliases for these functions, e.g.

#define res_nmkquery __res_nmkquery

 [2003-12-10 11:57 UTC] andy at kksonline dot com
Hi !
I have checked both things.
main/php_config.h looks fine

I have taken look into /usr/include/resolv.h

There are quite a few res_* defines, but I checked, there are few res_n* defines missing, all those I reported to be produced (res_ninit, res_nmkquery, res_nsend and res_nclose).

Any idea what to do next. Where should these defines be linked to? Maybe I can ask on freebsd forum, but I need to know what I am looking for...

Andy
 [2003-12-11 06:37 UTC] sniper@php.net
Ask why bind has these functions but why doesn't your resolv.h  have the aliases..

This is not PHP bug.

 [2004-07-26 14:53 UTC] peti-ke at freemail dot hu
i had the same problem under fbsd 5.1.

than i tried different thing and finally it worked.

i deinstalled bind8 and put bind9 on it. than i did a portsclean -C -D -L -i

and after these thing the compile worked without any mistake.
 [2004-07-26 20:45 UTC] ronnie at rustybrick dot com
Indeed, php5 compiled fine on my FreeBSD box until I installed bind 8.  Then, after recompiling, the above errors occurred.  PHP 4 works fine either way.  Was php 5 assuming Bind 9?
 [2004-08-11 22:17 UTC] shrooms at gmail dot com
I had the same problem on machines ranging from FreeBSD 4.6 to 5.2. This is how I got it to work.

If you have a resolv.h in /usr/include, do the following.
(don't forget to backup)

cd /usr/local/bind/
(for safety)
mv include oldinclude
mv lib oldlib
ln -s /usr/include include
ln -s /usr/lib lib

now Download the Bind 8 (source) and compile it. it will put a new working resolv.h in /usr/include and the other appropriate files, It will also put the appropriate libs in the lib dir.

Now you should be able to compile php 5 as normal.

Hope this helps.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 13:01:59 2014 UTC