Note that there are some explanatory texts on larger screens.

plurals
  1. POErrors linking libresolv when building PHP 5.2.10 from source on OS X
    text
    copied!<p>To begin with, I would normally opt to use a pre-compiled binary of PHP, but am required to build from source for a specific business need. (I'm not the type that compiles open-source apps just for kicks.)</p> <p>I'm building on OS X 10.6 and am running into the following error when I try to <code>make</code> PHP 5.2.10 as an Apache module (<code>--with-apxs2</code>):</p> <pre><code>Undefined symbols: "_res_9_dn_expand", referenced from: _zif_dns_get_mx in dns.o "_res_9_search", referenced from: _zif_dns_get_mx 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_mx in dns.o ld: symbol(s) not found </code></pre> <p>These symbols are part of <code>libresolv</code>, which is included at <code>/usr/lib/libresolv.dylib</code> on OS X (and has been since <em>at least</em> 10.4). Note that <code>*.dylib</code> files are the Mac equivalent of <code>*.so</code> files on Linux, and I've successfully compiled in <code>libiconv.dylib</code> already by passing <code>--with-iconv=shared,/usr</code> to <code>./configure</code>, which eliminated similar linker errors for the <code>iconv</code> library.</p> <p>When I run <code>./configure</code>, it detects <code>/usr/include/resolv.h</code> and enables it in the makefile. However, I can't seem to figure out how to get the shared library to link in correctly. Any tips on getting that to work? I've never done anything like passing custom linker flags to <code>./configure</code>, and Google has been no help to me for this problem, unfortunately.</p> <hr> <p><strong>Edit:</strong> I'm building from <a href="http://www.php.net/distributions/php-5.2.10.tar.gz" rel="nofollow noreferrer">this TAR download</a> if anyone wants to try to replicate the error on Snow Leopard.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload