Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #11283 (new defect)

Opened 19 months ago

Last modified 4 months ago

BUG: php5 installation fails if bind9 is already installed

Reported by: sander@… Owned by: ryandesign@…
Priority: Normal Milestone: Port Bugs
Component: ports Version:
Keywords: Cc: sander@…, ryandesign@…

Description

If first installing port install bind9 and then trying to install php5 (+apache2 +mysql +postgresql +pear) I get a linker error.

Unresolved external _res_nclose and a few more.

Deactivating bind9, install php5 and activating bind9 works.

Attachments

patch-configure.diff (150.3 kB) - added by blb@… 9 months ago.
Patch file for configure (add to patchfiles)
config.m4.diff (0.6 kB) - added by blb@… 9 months ago.
Patch to ext/standard/config.m4
php_config.h.patch (1.2 kB) - added by synfinatic@… 4 months ago.
patch against main/php_config (post configure) to fix build against Bind9

Change History

Changed 19 months ago by ryandesign@…

  • owner changed from macports-dev@… to ryandesign@…
  • summary changed from php5 installatioen with bind9 installed not working to php5 installation fails if bind9 is already installed

Changed 19 months ago by ryandesign@…

Ok, but unfortunately I don't know what to do to fix that. I see some references to this problem, for example here:

http://bugs.php.net/bug.php?id=26544

but I'm unclear on how to apply that to a fix in MacPorts. Anybody else know what we should do?

Changed 17 months ago by pipping@…

  • milestone set to Port Bugs

Changed 13 months ago by nox@…

  • priority changed from Important to High
  • version 1.3.2 deleted
  • summary changed from php5 installation fails if bind9 is already installed to BUG: php5 installation fails if bind9 is already installed

Changed 12 months ago by ryandesign@…

  • cc sander@…, ryandesign@… added

Changed 9 months ago by blb@…

Patch file for configure (add to patchfiles)

Changed 9 months ago by blb@…

Attached a patch to configure that should deal with this. Many of the changes are simply configure line number changes since I actually changed ext/standard/config.m4 to update the tests for res_nmkquery, res_nsend, and dn_expand to not look in libbind for them. Regenerating configure then results in the patch attached here.

Basically, the problem is that php checks for both res_nmkquery and __res_nmkquery (via the PHP_CHECK_FUNC def) but the code in ext/standard/dns.c only uses res_nmkquery; libbind with the bind9 port only has __res_nmkquery, hence the link errors.

Changed 9 months ago by blb@…

Patch to ext/standard/config.m4

Changed 9 months ago by blb@…

Just attached the patch to use to generate a new configure file that works for the Mac. Once this patch is applied, you need to run autoconf version 2.13 (the autoconf213 port) to create a new configure. This can then be diffed to the original configure to get the patch for it. Note that there may be a few meaningless updates ('int main' versus just 'main') which I did trim out of the original patch-configure.diff. These can be left in if wanted, since they shouldn't change any functionality.

The main advantage to doing it this way instead of just including the config.m4 patch is that this only requires you to run autoconf the one time, instead of everyone wanting php5 needing to install autoconf213 and running it prior to configure.

Note this fix may be Mac-specific and a better general fix would be for the php5 autotools stuff to detect that things like __ res_nmkquery are there but not res_nmkquery and to act appropriately.

Changed 4 months ago by synfinatic@…

any chance this bug will ever get fixed?

Changed 4 months ago by ryandesign@…

  • priority changed from High to Normal

I feel badly about adding a 150K patch to the port, which will have to be updated for each new version of PHP. I wish the PHP developers would fix this issue.

Changed 4 months ago by synfinatic@…

As a user, I'd gladly download 150K extra if the f***ing thing actually worked. Right now my PHP5 install is BROKEN since I have to uninstall Bind to compile. Hence, PHP5 can't do any DNS resolution so things like Akismet don't work, so I'm getting inundated with spam on my sites.

Changed 4 months ago by synfinatic@…

patch against main/php_config (post configure) to fix build against Bind9

Changed 4 months ago by synfinatic@…

Anyways, here's a much smaller patch (post configure) against main/php_config.h which undefs the things which break the build. Works for me. YMMV.

Note: See TracTickets for help on using tickets.