Saturday, December 8, 2012

macports php5 iconv

I was surprised to find that on macports, php5 does not have iconv included by default.
To get started, I removed all of the versions of PHP that I had, and then did:

sudo port install php5 +apache2 +mysql5 +pear +postgresql +pear php5-curl php5-gd php5-iconv php5-imagick php5-imap php5-mbstring php5-mcrypt php5-mysql php5-pcntl php5-posix php5-soap php5-sockets php5-sqlite php5-xmlrpc php5-xsl php53-apache2handler

After doing that, I still didn't have iconv loading even though apache was loading php. I had to update php.ini with the extensions explicitly. I had to also specify the path:
extension=/opt/local/lib/php/extensions/no-debug-non-zts-20090626/iconv.so

(remember to check phpinfo(); to see which php.ini file is being used!)

No comments:

Post a Comment