Discussion:
[PHP-INSTALL] Can't get --enable-intl to work with 5.3.8
Luke Scott
2011-11-04 20:13:18 UTC
Permalink
I'm trying to compile PHP 5.3.8 with the intl extension.
This extension requires icu, which requires --with-icu-dir=.

I was able to compile icu fine. I've tried version 3.8 to 4.8.
But when I tried to compile PHP it complained about UChar already
being defined in both libxml2 and icu.

After doing a little research it seemed the only way to fix it was
compile libxml2 myself with the --with-icu flag. But I ran into some
problems getting libxml2 to compile with --prefix. After patching its
configure.in I was able to get it to compile.

With the newly compiled libxml2 and --with-libxml-dir= pointing to
it's location PHP's ./configure fails complaining about libxml2 not
working. In the config.log it says something about conftest.c.
This file doesn't exist. But there is a conftest.cpp.

Here is the config.log: http://pastebin.com/qKezu2Z3
Here are the commands I'm running: http://pastebin.com/dYQwUCm0
And here is the patch file for libxml2: http://pastebin.com/ss0L6ZLw

All the versions I'm using are in the second link.


What am I doing wrong? Has anyone gotten this to compile successfully?

Luke
Partha Chowdhury
2011-11-06 04:03:50 UTC
Permalink
Post by Luke Scott
I'm trying to compile PHP 5.3.8 with the intl extension.
This extension requires icu, which requires --with-icu-dir=.
I just was able to compile php 5.3.8 with --enable-intl.

my config.log: http://pastebin.com/c7dAwKy8
Post by Luke Scott
I was able to compile icu fine. I've tried version 3.8 to 4.8.
But when I tried to compile PHP it complained about UChar already
being defined in both libxml2 and icu.
My icu version is 4.2.1.It is installed in /usr.I did not needed the
"--with-icu-dir" option.
Post by Luke Scott
After doing a little research it seemed the only way to fix it was
compile libxml2 myself with the --with-icu flag. But I ran into some
problems getting libxml2 to compile with --prefix. After patching its
configure.in I was able to get it to compile.
My libxml2 version is 2.7.7 and i configured it with only "./configure
--prefix=/usr".It did not need any patching.

<snipped>
Luke Scott
2011-11-07 03:21:16 UTC
Permalink
Looks like an issue with libxml 2.7.8. Issue gone with 2.7.7.

Still having problems compiling this on OS X 10.6.
I've searched around and tried every suggestion I could find.
Still can't get it to compile correctly.

First I get this:

Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
_umsg_parse_helper in msgformat_helpers.o
_umsg_format_helper in msgformat_helpers.o
"___gxx_personality_v0", referenced from:
Dwarf Exception Unwind Info (__eh_frame) in msgformat_helpers.o
"_res_9_init", referenced from:
_zif_dns_get_mx in dns.o
_zif_dns_get_record in dns.o
_zif_dns_check_record in dns.o
"_res_9_search", referenced from:
_zif_dns_get_mx in dns.o
_zif_dns_get_record 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_record in dns.o
"_res_9_dn_expand", referenced from:
_zif_dns_get_mx in dns.o
_php_parserr in dns.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] Error 1


I read the "___gxx_personality_v0" is a problem with the intl extension on
OS X.
The proposed solution is adding "-lstdc++".
The rest of the problems is solved by adding "-lresolv".

But now I get this:

dyld: Library not loaded: libicui18n.48.dylib
Referenced from: /Server/src/php-5.3.8/sapi/cli/php
Reason: image not found
/bin/sh: line 1: 44411 Trace/BPT trap ` if test -x
"/Server/src/php-5.3.8/sapi/cli/php"; then
/Server/src/php-5.3.8/build/shtool echo -n --
"/Server/src/php-5.3.8/sapi/cli/php -n"; if test "x" != "x"; then
/Server/src/php-5.3.8/build/shtool echo -n -- " -d
extension_dir=/Server/src/php-5.3.8/modules"; for i in bz2 zlib phar; do
if test -f "/Server/src/php-5.3.8/modules/$i.la"; then .
/Server/src/php-5.3.8/modules/$i.la; /Server/src/php-5.3.8/build/shtool
echo -n -- " -d extension=$dlname"; fi; done; fi; else
/Server/src/php-5.3.8/build/shtool echo -n --
"/Server/src/php-5.3.8/sapi/cli/php"; fi;` -d 'open_basedir=' -d
'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d
'safe_mode=0' /Server/src/php-5.3.8/ext/phar/build_precommand.php >
ext/phar/phar.php
make: *** [ext/phar/phar.php] Error 133



If I compile it without the intl extension everything works (without
adding "-lresolv").

Anyone know how to solve this?

Luke Scott
Post by Partha Chowdhury
Post by Luke Scott
I'm trying to compile PHP 5.3.8 with the intl extension.
This extension requires icu, which requires --with-icu-dir=.
I just was able to compile php 5.3.8 with --enable-intl.
my config.log: http://pastebin.com/c7dAwKy8
Post by Luke Scott
I was able to compile icu fine. I've tried version 3.8 to 4.8.
But when I tried to compile PHP it complained about UChar already
being defined in both libxml2 and icu.
My icu version is 4.2.1.It is installed in /usr.I did not needed the
"--with-icu-dir" option.
Post by Luke Scott
After doing a little research it seemed the only way to fix it was
compile libxml2 myself with the --with-icu flag. But I ran into some
problems getting libxml2 to compile with --prefix. After patching its
configure.in I was able to get it to compile.
My libxml2 version is 2.7.7 and i configured it with only "./configure
--prefix=/usr".It did not need any patching.
<snipped>
Loading...