Wednesday, September 10, 2008
Using Macports instead!
I tried installing Macports instead, which uses the normal x86 apache2 server, and nicely keeps all files in /opt, separate from the normal /usr installation tree. Everything now works, including libmcrypt and mhash! Bye bye, Leopard version of apache2!
Monday, September 1, 2008
PHP/MySQL on Mac OS X Leopard?
Since I've gotten more used to my Macbook Pro now, I'm beginning to explore what comes with Mac OS X Leopard. I'm quite pleased to discover that Leopard comes with Apache and PHP 5. However, I also want to use PDO with MySQL. I search the net for pointers on how to do this, and find a few approaches, but the best seems to be to compile PHP myself!
So I download PHP 5.2.6, and compile it, only to find that libiconv that comes with Leopard is not built for x86_64 architecture. No problem, just download libiconv from GNU.org, and compile it. Amazingly, I got it to work. But what's really strange is that after coming back to my little tinkering project after a month, apachectl configtest tells me that libphp5.so can't find the symbol _iconv. That darn libiconv again! What happened? I didn't change anything!
I search the symbol table in libiconv using nm, and behold, there is no _iconv symbol defined, only _iconv_canonicalize. What is the heck is that? I look at the iconv.c source file in libiconv-1.12/lib, and I find the following block of code:
#if defined __FreeBSD__ && !defined __gnu_freebsd__
GNU libiconv is the native FreeBSD iconv implementation since 2002.
It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.
#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
#define _strong_alias(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
#undef iconv_open
#undef iconv
#undef iconv_close
strong_alias (libiconv_open, iconv_open)
strong_alias (libiconv, iconv)
strong_alias (libiconv_close, iconv_close)
Wait, I'm not on FreeBSD, and I didn't see any __FreeBSD__ preprocessor constant defined. What the heck? Search the web, and someone suggests compiling PHP without libiconv, --without-libiconv. I give that a whirl, and it works. Yeah, I don't plan on doing any i18n/l10n stuff just yet.
But if anyone can shed any light on what's wrong with my libiconv library, I'd really appreciate it!
So I download PHP 5.2.6, and compile it, only to find that libiconv that comes with Leopard is not built for x86_64 architecture. No problem, just download libiconv from GNU.org, and compile it. Amazingly, I got it to work. But what's really strange is that after coming back to my little tinkering project after a month, apachectl configtest tells me that libphp5.so can't find the symbol _iconv. That darn libiconv again! What happened? I didn't change anything!
I search the symbol table in libiconv using nm, and behold, there is no _iconv symbol defined, only _iconv_canonicalize. What is the heck is that? I look at the iconv.c source file in libiconv-1.12/lib, and I find the following block of code:
#if defined __FreeBSD__ && !defined __gnu_freebsd__
GNU libiconv is the native FreeBSD iconv implementation since 2002.
It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.
#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
#define _strong_alias(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
#undef iconv_open
#undef iconv
#undef iconv_close
strong_alias (libiconv_open, iconv_open)
strong_alias (libiconv, iconv)
strong_alias (libiconv_close, iconv_close)
Wait, I'm not on FreeBSD, and I didn't see any __FreeBSD__ preprocessor constant defined. What the heck? Search the web, and someone suggests compiling PHP without libiconv, --without-libiconv. I give that a whirl, and it works. Yeah, I don't plan on doing any i18n/l10n stuff just yet.
But if anyone can shed any light on what's wrong with my libiconv library, I'd really appreciate it!
Subscribe to:
Posts (Atom)