cannot compile PHP 5.2.11 on Mac OS X 10.6.1

cannot compile PHP 5.2.11 on Mac OS X 10.6.1

am 25.10.2009 00:33:50 von Mari Masuda

Hi,

I am setting up my Mac Book Pro running Mac OS X 10.6.1 as a
development environment for Drupal. I already successfully have MySQL
5.1.40 and Apache 2.2.11 up and running. I tried to compile PHP
5.2.11 in the following manner and keep getting an error. Any help
would be great!

1. Downloaded php-5.2.11.tar.gz from php.net. The MD5 checksum of
the downloaded file is the same as what is listed on php.net so I do
not think the file is corrupt.
2. Expanded php-5.2.11.tar.gz by double-clicking the file I
downloaded and moving the resulting folder (named "php-5.2.11") to my
desktop.

In terminal did the following (I am following the instructions in the
box labeled "Example #1 Installation Instructions (Apache 2 Shared
Module Version)" at http://www.php.net/manual/en/install.unix.apache2.php
)
3. cd /Users/mari/Desktop/php-5.2.11
4. ./configure --prefix=/Applications/php --disable-short-tags --with-
mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config
--with-apxs2=/Applications/apache/bin/apxs --enable-mbstring --with-
pdo-mysql=/usr/local/mysql
5. make

At this point, make does not complete and it exits with an error:

---start error---
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
"_libiconv", referenced from:
__php_iconv_strlen in iconv.o
_php_iconv_string in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_appendl in iconv.o
__php_iconv_appendl in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.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
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
---end error---

To try to simplify things, I deleted the php-5.2.11 folder I created
in step 2 above and repeated steps 2 and 3. Then at this point I only
did ./configure by itself with no options, thinking that I could try
to see if any of my configuration options were causing the issue.
Alas, no, the problem still happens; the error is now this:

---start error---
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
"_libiconv", referenced from:
__php_iconv_strlen in iconv.o
_php_iconv_string in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_appendl in iconv.o
__php_iconv_appendl in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.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
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
---end error---

What can I do to get around this problem and compile PHP? Thanks!

Mari

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[SOLVED] Re: [PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1

am 25.10.2009 17:35:20 von Mari Masuda

Hi,

So I found out there are two bugs filed in bugs.php.net that are
related to this problem. The bugs are http://bugs.php.net/bug.php?id=49332and
http://bugs.php.net/bug.php?id=49267.

To anyone else that has the same issues as me, here is how to get
around the problem if you are trying to compile a freshly downloaded
copy of PHP 5.2.11 on Mac OS X 10.6.1.

1. First, open /ext/iconv/iconv.c and edit line 197.
Lines 196-198 look like this originally:
---
#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif
---
You need to change it to look like this:
---
#ifdef HAVE_LIBICONV
#define iconv iconv
#endif
---

2. When you run ./configure, prepend LIBS=-lresolv so the resulting
command is:
---
LIBS=-lresolv ./configure <...your options here...>
---

Now when you run make you should not get a compilation error and you
should be able to follow the rest of the instructions on http://www.php.net/manual/en/install.unix.apache2.php
to get your PHP 5.2.11 up and running.

Mari


On Oct 24, 2009, at 15:33, Mari Masuda wrote:

> Hi,
>
> I am setting up my Mac Book Pro running Mac OS X 10.6.1 as a
> development environment for Drupal. I already successfully have
> MySQL 5.1.40 and Apache 2.2.11 up and running. I tried to compile
> PHP 5.2.11 in the following manner and keep getting an error. Any
> help would be great!
>
> 1. Downloaded php-5.2.11.tar.gz from php.net. The MD5 checksum of
> the downloaded file is the same as what is listed on php.net so I do
> not think the file is corrupt.
> 2. Expanded php-5.2.11.tar.gz by double-clicking the file I
> downloaded and moving the resulting folder (named "php-5.2.11") to
> my desktop.
>
> In terminal did the following (I am following the instructions in
> the box labeled "Example #1 Installation Instructions (Apache 2
> Shared Module Version)" at http://www.php.net/manual/en/install.unix.apache2.php
> )
> 3. cd /Users/mari/Desktop/php-5.2.11
> 4. ./configure --prefix=/Applications/php --disable-short-tags --
> with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/
> mysql_config --with-apxs2=/Applications/apache/bin/apxs --enable-
> mbstring --with-pdo-mysql=/usr/local/mysql
> 5. make
>
> At this point, make does not complete and it exits with an error:
>
> ---start error---
> 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
> "_libiconv", referenced from:
> __php_iconv_strlen in iconv.o
> _php_iconv_string in iconv.o
> _php_iconv_string in iconv.o
> __php_iconv_strpos in iconv.o
> __php_iconv_appendl in iconv.o
> __php_iconv_appendl in iconv.o
> _zif_iconv_substr in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _php_iconv_stream_filter_append_bucket in iconv.o
> _php_iconv_stream_filter_append_bucket in iconv.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
> collect2: ld returned 1 exit status
> make: *** [libs/libphp5.bundle] Error 1
> ---end error---
>
> To try to simplify things, I deleted the php-5.2.11 folder I created
> in step 2 above and repeated steps 2 and 3. Then at this point I
> only did ./configure by itself with no options, thinking that I
> could try to see if any of my configuration options were causing the
> issue. Alas, no, the problem still happens; the error is now this:
>
> ---start error---
> 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
> "_libiconv", referenced from:
> __php_iconv_strlen in iconv.o
> _php_iconv_string in iconv.o
> _php_iconv_string in iconv.o
> __php_iconv_strpos in iconv.o
> __php_iconv_appendl in iconv.o
> __php_iconv_appendl in iconv.o
> _zif_iconv_substr in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _zif_iconv_mime_encode in iconv.o
> _php_iconv_stream_filter_append_bucket in iconv.o
> _php_iconv_stream_filter_append_bucket in iconv.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
> collect2: ld returned 1 exit status
> make: *** [sapi/cgi/php-cgi] Error 1
> ---end error---
>
> What can I do to get around this problem and compile PHP? Thanks!
>
> Mari
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php