\nbrew install libjpeg\nbrew install pcre\nbrew install libxml2\nbrew install mcrypt\nbrew install icu4c\nbrew link icu4c --force\nbrew install imap-uw\n<\/pre>\nAfter that I configured PHP with the following options (apxs config apache to use this version of php, it’s importain):<\/p>\n
\n.\/configure \\\n--prefix=\/usr \\\n--mandir=\/usr\/share\/man \\\n--infodir=\/usr\/share\/info \\\n--sysconfdir=\/private\/etc \\\n--with-apxs2=\/usr\/sbin\/apxs \\\n--enable-cli \\\n--with-config-file-path=\/etc \\\n--with-libxml-dir=\/usr \\\n--with-openssl=\/usr \\\n--with-kerberos=\/usr \\\n--with-zlib=\/usr \\\n--enable-bcmath \\\n--with-bz2=\/usr \\\n--enable-calendar \\\n--with-curl=\/usr \\\n--enable-dba \\\n--enable-exif \\\n--enable-ftp \\\n--with-gd \\\n--enable-gd-native-ttf \\\n--with-icu-dir=\/usr\/local\/opt\/icu4c \\\n--with-iodbc=\/usr \\\n--with-ldap=\/usr \\\n--with-ldap-sasl=\/usr \\\n--with-libedit=\/usr \\\n--enable-mbstring \\\n--enable-mbregex \\\n--with-mysql=mysqlnd \\\n--with-mysqli=mysqlnd \\\n--without-pear \\\n--with-pdo-mysql=mysqlnd \\\n--with-mysql-sock=\/tmp\/mysql.sock \\\n--with-readline=\/usr \\\n--enable-pcntl \\\n--enable-shmop \\\n--with-snmp=\/usr \\\n--enable-soap \\\n--enable-sockets \\\n--enable-sysvmsg \\\n--enable-sysvsem \\\n--enable-sysvshm \\\n--with-tidy \\\n--enable-wddx \\\n--with-xmlrpc \\\n--with-iconv-dir=\/usr \\\n--with-mcrypt \\\n--with-xsl=\/usr \\\n--enable-zip \\\n--with-imap=\/usr\/local\/imap-2007 \\\n--with-kerberos \\\n--with-imap-ssl \\\n--enable-intl \\\n--with-pcre-regex \\\n--with-pgsql=\/usr \\\n--with-pdo-pgsql=\/usr \\\n--with-freetype-dir=\/usr\/X11 \\\n--with-jpeg-dir=\/usr \\\n--with-png-dir=\/usr\/X11\n<\/pre>\nFollowed by:<\/p>\n
\nmake\nmake test\n\n<\/pre>\nSome tests may failed, but it’s ok we have nothing to do with it. Finally, you can install PHP with:<\/p>\n
\n\nsudo make install\n\n<\/pre>\n
\nTo install other modules like intl, check out pecl to install it. This is my quick guide for system that already has PHP installed.<\/p>\n
\n\ncd \/usr\/lib\/php\nsudo php install-pear-nozlib.phar\n\n<\/pre>\nEdit\/etc\/php.ini and find the line: ;include_path = “.:\/php\/includes” and change it to:
\ninclude_path = “.:\/usr\/lib\/php\/pear”<\/p>\n
Then, execute following commands to update & add new channels<\/p>\n
\n\nsudo pear channel-update pear.php.net\nsudo pecl channel-update pecl.php.net\nsudo pear upgrade-all\nsudo pear channel-discover pear.phpunit.de\nsudo pear channel-discover components.ez.no\nsudo pear channel-discover pear.symfony-project.com\n\n<\/pre>\nFrom this point, you can install many other PHP utilities as you wish<\/p>\n
\n\nsudo pear install phpunit\/PHPUnit\nsudo pear install phpunit\/phpcpd\nsudo pear install PHP_CodeSniffer\nsudo pecl install apc\nsudo pecl install intl\nsudo pecl install xdebug\n\n<\/pre>\nnote: remember to follow output instruction after install each module from pecl or pear from console screen.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"Mac OSX has a lot of Unix utilities, they’re very useful. You can start using many of your favorite Unix\/Linux application out-of-the-box. But when it come to PHP, it’s not as good as PHP on Linux, What you have is an outdated version and you don’t have new features and performance of latest PHP .In…<\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,46,53],"tags":[92,61,62],"aioseo_notices":[],"views":5,"_links":{"self":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts\/1077"}],"collection":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/comments?post=1077"}],"version-history":[{"count":0,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/posts\/1077\/revisions"}],"wp:attachment":[{"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/media?parent=1077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/categories?post=1077"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ndthanh.com\/wp-json\/wp\/v2\/tags?post=1077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}