[PHP] [SOLVED] Re: [PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1
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
[PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1
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
RE: [PHP] Cannot compile
Try running 'make clean' before you run 'make' again. I had a problem when trying to run 'make' for the umpteenth time during my recent troubles, and apparently it was because things got a little too cluttered, and this did the trick. Will -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 03, 2004 1:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Cannot compile On Tuesday 03 August 2004 14:30, Andrew W wrote: > It doesn't work regardless of whether I include any options or not. "doesn't work" can include umpteen billions of things. Please try to narrow it down a bit. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If you want your spouse to listen and pay strict attention to every word you say, talk in your sleep. */ -- 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
Re: [PHP] Cannot compile
On Tuesday 03 August 2004 14:30, Andrew W wrote: > It doesn't work regardless of whether I include any options or not. "doesn't work" can include umpteen billions of things. Please try to narrow it down a bit. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If you want your spouse to listen and pay strict attention to every word you say, talk in your sleep. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot compile
I'm using Linux. It doesn't work regardless of whether I include any options or not. On 2 Aug 2004, at 04:14, Support wrote: Sounds like configure did not work ok after all. :-) Did you include any options? What os? Any clues you could offer would help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot compile
I've compiled & installed software from source before but PHP 5 is proving a challenge. I've decompressed the tarball and cd into the directory. Run ./configure which seems to work ok but then when I do make I get the following error: "No targets specified and no makefile found" Sure enough there is no makefile in the directory so for some reason ./configure isn't creating one. Can anyone offer any help? Thanks AW -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot compile my extension as a shared .so library
Hi php-4.1.2 linux RH 7.2 I have created a small php extension. The extension works as expected when I compile it using $ ./configure --with-foo && make # foo is the extension It gets compiled into the php binary. All is well, but I would like to compile my extension as a loadable modules (ie to use with the dl() function). Thus $ ./configure --with-foo=shared && make The compilation completes with no errors. The php binary works (my foo ext is not included in the binary), but I end up with *no* 'foo.so' file. Instead I get this $ ls -l modules/ 51776 Apr 5 13:11 foo.a 647 Apr 5 13:11 foo.la I expected to see a 'foo.so' file. Obviously I cannot use dl() on these files. The foo extension is as simple as possible, just to illustrate the problem. It was created using these commands: 1. $ cd ~/php-4.1.2/ext 2. $ ./ext_skel --extname=foo 3. $ cd .. 4. $ vi ext/foo/config.m4 5. $ ./buildconf 6. $ ./configure --with-foo=shared 7. $ make The whole config.m4: PHP_ARG_WITH(foo, for foo support, [ --with-foo Include foo support]) if test "$PHP_FOO" != "no"; then PHP_EXTENSION(foo, $ext_shared) fi Output from make: make[3]: Entering directory `/home/wic/php-4.1.2/ext/foo' /bin/sh /home/wic/php-4.1.2/libtool --silent --mode=compile gcc -I. -I/home/wic/php-4.1.2/ext/foo -I/home/wic/php-4.1.2/main -I/home/wic/php-4.1.2 -I/home/wic/php-4.1.2/Zend -I/home/wic/php-4.1.2/ext/mysql/libmysql -I/home/wic/php-4.1.2/ext/xml/expat -I/home/wic/php-4.1.2/TSRM -g -O2 -prefer-pic -c foo.c && touch foo.slo /bin/sh /home/wic/php-4.1.2/libtool --silent --mode=link gcc -I. -I/home/wic/php-4.1.2/ext/foo -I/home/wic/php-4.1.2/main -I/home/wic/php-4.1.2 -I/home/wic/php-4.1.2/Zend -I/home/wic/php-4.1.2/ext/mysql/libmysql -I/home/wic/php-4.1.2/ext/xml/expat -I/home/wic/php-4.1.2/TSRM -g -O2 -prefer-non-pic -static -o foo.la -avoid-version -module -rpath /home/wic/php-4.1.2/modules foo.lo /bin/sh /home/wic/php-4.1.2/libtool --silent --mode=install cp foo.la /home/wic/php-4.1.2/modules PATH="$PATH:/sbin" ldconfig -n /home/wic/php-4.1.2/modules -- Libraries have been installed in: /home/wic/php-4.1.2/modules [etc...] Note that I can manually create a so-file from the foo.a file using ld as in: $ cd modules; ar x foo.a; ld -Bshareable -o foo.so foo.o and then call dl("foo.so"), but that is not the way to go, right??? I think there is some arcance libtool switch missing in the Makefile, or I need something else in the config.m4 file Btw, my real extension is a lot more complex, but it has the same problems so I figured this foo-thing would be a bit easier to debug :-) I have searched high and low for any leads, but nothing has turned up so far. /Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot compile PHP with APXS
Untared php 4.1.1 into /usr/local/src/php4.1.1 Untared apache 1.3.22 into /usr/local/src/apache-1.3.22 ran ./configure in apache there is /var/www/bin/apxs When configuring php : ./configure --with-mysql --with-apxs=/var/www/bin/apxs --with-xml error occurs that says either perl is not installed(but it is) or Apache was not compiled with DSO support(I built one with DSO) or apxs is not in the path but an output from "apxs" is shown. What to do? BTW I don't know how but succeeded to compile Apache with mod_php4.c(static module). Added AddType in /etc/httpd/conf/httpd.conf but apache do not recognize .php files. TIA Andrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot compile 4.0.6 on RedHat 6.2
Hi! I'm trying to compile PHP 4.0.6 on RedHat 6.2. Running make, I get the errors below. Anyone got an idea about what's wrong? Configure ran without a problem, with these options: --enable-bcmath --enable-exif --enable-ftp--enable-dba=shared --enable-dbx --enable-magic-quotes --enable-safe-mode --enable-sysvshm --enable-sysvsem--enable-trans-sid --enable-versioning --with-apxs=/usr/local/apache/bin/apxs --with-gdbm --with-gd --with-imap --with-jpeg-dir=/usr--with-mysql=/usr --with-openssl --with-png-dir --with-ttf --with-swf=../dist --with-xpm-dir=/usr/X11R6 --with-zlib Software used: root@host [~/builds/php-4.0.6]# rpm -qa|sort|grep -i '\(egcs\|glibc\|stdc\)' egcs-1.1.2-30 egcs-c++-1.1.2-30 glibc-2.1.3-22 glibc-devel-2.1.3-22 libstdc++-2.9.0-30 Thanks a lot! --- Making all in Zend make[1]: Entering directory `/root/builds/php-4.0.6/Zend' /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../main -DLINUX=22 -DMOD_SSL=208104 -DUSE_HSREGEX -DEAPI -DUSE_EXPAT -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g -O2 -c zend_language_scanner.c In file included from /usr/include/stdio.h:57, from zend_language_scanner.c:28: /usr/include/libio.h:214: parse error before `__off_t' /usr/include/libio.h:214: warning: no semicolon at end of struct or union /usr/include/libio.h:233: parse error before `_offset' /usr/include/libio.h:233: warning: data definition has no type or storage class /usr/include/libio.h:237: parse error before `}' /usr/include/libio.h:262: parse error before `__io_read_fn' /usr/include/libio.h:263: warning: data definition has no type or storage class /usr/include/libio.h:271: parse error before `__io_write_fn' /usr/include/libio.h:272: warning: data definition has no type or storage class /usr/include/libio.h:280: parse error before `__off_t' /usr/include/libio.h:367: parse error before `_IO_padn' /usr/include/libio.h:367: parse error before `__ssize_t' /usr/include/libio.h:367: warning: data definition has no type or storage class /usr/include/libio.h:370: parse error before `_IO_seekoff' /usr/include/libio.h:370: parse error before `__off64_t' /usr/include/libio.h:370: warning: data definition has no type or storage class /usr/include/libio.h:371: parse error before `_IO_seekpos' /usr/include/libio.h:371: parse error before `__off64_t' /usr/include/libio.h:371: warning: data definition has no type or storage class In file included from zend_language_scanner.c:28: /usr/include/stdio.h:61: parse error before `fpos_t' /usr/include/stdio.h:61: warning: data definition has no type or storage class In file included from zend_language_scanner.c:28: /usr/include/stdio.h:477: parse error before `off_t' /usr/include/stdio.h:477: warning: data definition has no type or storage class /usr/include/stdio.h:500: parse error before `fpos_t' /usr/include/stdio.h:502: parse error before `*' /usr/include/bits/stdio.h: In function `getc_unlocked': In file included from /usr/include/stdio.h:635, from zend_language_scanner.c:28: /usr/include/bits/stdio.h:51: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:51: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:51: dereferencing pointer to incomplete type /usr/include/bits/stdio.h: In function `getchar_unlocked': /usr/include/bits/stdio.h:58: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:58: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:58: dereferencing pointer to incomplete type /usr/include/bits/stdio.h: In function `fputc_unlocked': /usr/include/bits/stdio.h:76: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:76: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:76: dereferencing pointer to incomplete type /usr/include/bits/stdio.h: In function `putc_unlocked': /usr/include/bits/stdio.h:86: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:86: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:86: dereferencing pointer to incomplete type /usr/include/bits/stdio.h: In function `putchar_unlocked': /usr/include/bits/stdio.h:93: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:93: dereferencing pointer to incomplete type /usr/include/bits/stdio.h:93: dereferencing pointer to incomplete type /usr/include/bits/stdio.h: In function `feof_unlocked': /usr/include/bits/stdio.h:113: dereferencing pointer to incomplete type /usr/include/bits/stdio.h: In function `ferror_unlocked': /usr/include/bits/stdio.h:120: dereferencing pointer to incomplete type /usr/include/sys/types.h: At top level: In file included from /usr/include/stdlib.h:339, from ../main/php_config.h:1919, from zend_config.h:1, from zend.h:44, from zend_language