Mac os 10.11(El Capitan) System Build in PHP's GB missing FreeType

In Mac os 10.11(El Capitan) System's build in PHP. The GB lib is missing FreeType part, it will cost problem for captcha and png render. The only solution is to reinstall a new PHP.

I already used Brew install the PHP7, so I have to fix the build in PHP5 to keep two PHPs working together(by different php-fpm port). I found it's very hard to fix the system build in, but I also found it's very easy to install a new PHP5.6, and it will not effect the build in PHP5 and Brew's PHP7, that's my style, This topic will show how to install the new PHP 5.6


{ 1. Stop System Build in PHP5's php-fpm }

//check fpm status
lsof -Pni4 | grep LISTEN | grep php

php-fpm    1344           root    7u  IPv4 0x38ac445a645f3bc1      0t0  TCP (LISTEN)
php-fpm    1346         nobody    0u  IPv4 0x38ac445a645f3bc1      0t0  TCP (LISTEN)
php-fpm    1347         nobody    0u  IPv4 0x38ac445a645f3bc1      0t0  TCP (LISTEN)

//stop php-fpm
kill 1344 //just need kiss the one belong to root

//check fpm status again, zero result
lsof -Pni4 | grep LISTEN | grep php


{ install new PHP5.6 }


PHP 5.6 (Current stable)
curl -s | bash -s 5.6

//open termial
run "curl -s | bash -s 5.6"

//need input password


{ Config new PHP5.6 }

//new php folder, same folder

because the install location, you can keep Mac's build in PHP and the new PHP5.6 together, and we will never use the build in one again.

//check new php version
/usr/local/php5/bin/php -v

//change php.ini for the new php5.6
//only need change this one, just forgot /usr/local/php5/lib/php.ini

//config php-fpm
cp php-fpm.conf.default php-fpm.conf

//run php-fpm
//need sudo -i, switch to root user first


{ In All }

You can use the above idea to install a new PHP7 too, without Brew!! The New PHP5.6 is very good.

{ Links }