New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #11283 (closed defect: fixed)

Opened 2 years ago

Last modified 2 months ago

BUG: php5 installation fails if bind9 is already installed

Reported by: sander@… Owned by: ryandesign@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jwa@…, blb@…, synfinatic@…, frankelma@…
Port: php5, php5-devel

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@… 19 months ago.
Patch file for configure (add to patchfiles)
config.m4.diff (0.6 KB) - added by blb@… 19 months ago.
Patch to ext/standard/config.m4
php_config.h.patch (1.2 KB) - added by synfinatic@… 14 months ago.
patch against main/php_config (post configure) to fix build against Bind9

Change History

  Changed 2 years 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 2 years 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 2 years ago by pipping@…

  • milestone set to Port Bugs

  Changed 23 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 22 months ago by ryandesign@…

  • cc sander@…, ryandesign@… added

Changed 19 months ago by blb@…

Patch file for configure (add to patchfiles)

  Changed 19 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 19 months ago by blb@…

Patch to ext/standard/config.m4

  Changed 19 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 15 months ago by synfinatic@…

any chance this bug will ever get fixed?

  Changed 15 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 14 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 14 months ago by synfinatic@…

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

  Changed 14 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.

follow-up: ↓ 14   Changed 8 months ago by blb@…

  • port set to php5

You can use the config.m4.diff I attached, then add autoconf213 to depends_build and

patchfiles     config.m4.diff
use_autoconf   yes
autoconf.cmd   ${prefix}/bin/autoconf213

Then no big patch and autoconf213 doesn't take but a few seconds to run.

  Changed 8 months ago by ryandesign@…

  • port changed from php5 to php5, php5-devel

Has duplicate #17207.

in reply to: ↑ 12   Changed 8 months ago by ryandesign@…

  • cc jwa@…, blb@…, synfinatic@…, frankelma@… added; sander@…, ryandesign@… removed
  • status changed from new to closed
  • resolution set to fixed

Replying to blb@…:

You can use the config.m4.diff I attached, then add autoconf213 to depends_build [snip] Then no big patch and autoconf213 doesn't take but a few seconds to run.

Thanks, Bryan. That sounds good to me. Fixed php5-devel in r41985 and php5 in r41986. php4 does not appear to be affected. Sorry it's taken so long to get this fixed.

  Changed 2 months ago by anonymous

  • milestone Port Bugs deleted

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.