Apple Mac OS X El Capitan 10.11
Latest Apple Mac OS X release includes PHP Version 5.5.31 out of the box as usual. In order to have PHP working, just follow instructions as for older versions. PHP has a number of useful extensions included: bz2, curl, ftp, gd, iconv, json, ldap, libxml, mbstring, mysqlnd, PDO, pdo_mysql, pdo_sqlite, PHAR, Reflection, SimpleXML, snmp, soap, sqlite3, zip and zlib.
You can download the binary packages of following extensions not included in the operating system and copy all of them into the folder:
/usr/lib/php/extensions/no-debug-non-zts-20121212OS X El Capitan features a rootless mode that helps protect Macs from malicious software denying you from writing into system protected folders. If you want to copy files you must have System Integrity Protection disabled. To disable SIP you can reboot the system keeping pressed CMD + R keys and, once you are in Recovery Mode, launch Terminal and input the following:
csrutil disable; reboot
Curve25519
[SHA-1 = 9937941df34bee1c1b754e32d18f04fd58d1d33f]
Curve25519 is an elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme. Curve25519 PHP extension is a thin wrapper around Adam Langley’s curve25519-donna implementation. Add the following line to your php.ini:
extension = curve25519.so
MCrypt
[SHA-1 = 4b870ab49f64d2d9bce8b2b54fa5c9e90008d8c9]
Add the following line to your php.ini:
extension = mcrypt.so
MSSQL
[SHA-1 = 918923984d2ee9f06ce9c71ec458234011781752]
Requires FreeTDS library and configuration of /etc/freetds/conf/freetds.conf file. Add the following line to your php.ini:
extension = mssql.so
PDO DBLIB
[SHA-1 = 17e8e9dc2c57af9a8817c86e79b7002da4cabcba]
Requires FreeTDS library and configuration of /etc/freetds/conf/freetds.conf file. Add the following line to your php.ini:
extension = pdo_dblib.so
Process Control
[SHA-1 = 46c129c624bcfaab27611c789cf11150035c4a32]
Process Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination. Process Control should not be enabled within a web server environment and unexpected results may happen if any Process Control functions are used within a web server environment. Add the following line to your php.ini:
extension = pcntl.so
Protocol Buffers
[SHA-1 = 142ba246d74cd43802ca86ac7955657ae047ed3b]
Protocol Buffers is a method of serializing structured data developed by Google. It is useful in developing programs to communicate with each other over a wire or for storing data. The method involves an interface description language that describes the structure of some data and a program that generates source code from that description for generating or parsing a stream of bytes that represents the structured data. Protobuf PHP extension is an implementation of Google's Protocol Buffers. Add the following line to your php.ini:
extension = protobuf.so
XDebug
[SHA-1 = c9e8eb7e769efe9f124522d619a55e3db1af2d09]
Requires XDebug extension. Add the following line to your php.ini:
extension = xdebug.so
Apple Mac OS X Snow Leopard 10.6
APC
[SHA-1 = 2bb17320d926be819c60ee12ec7fa43962ba295e]
Add the following line to your php.ini:
extension = apc.so
APC Upload Progess
[SHA-1 = ec5614846d74d3d5d4343235ecbf12df80bb288c]
Add the following line to your php.ini:
extension = uploadprogress.so
PHP CUPS
[SHA-1 = deff301e0edef8c743fc14125803252051d2b489]
PHP Server Side Printing extension. Add the following line to your php.ini:
extension = phpcups.so
ZIP
[SHA-1 = 40e686a28870f52d12f35273d8d51fa53814dfe6]
Add the following line to your php.ini:
extension = zip.so
Apple Mac OS X Leopard 10.5
Apple Mac OS X Leopard 10.5.5 has PHP 5.2.6 and Apache 2.2.8 builtin, so you could start to develop web projects on your computer right out of the box. Unfortunately, PHP has been compiled without useful extensions such GD Library, PDO_MySQL, etc. I’ve compiled them by myself (except ionCube) with x86_64 superset instruction support only; I share them with you for a faster setup of PHP development environment on your Mac.
If your PHP is still not enabled on Leopard, open the file /etc/apache2/httpd.conf and uncomment line 114:
LoadModule php5_module libexec/apache2/libphp5.so
PHP extensions must be placed in the folder specified in /etc/php.ini.
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"
MySQL DBMS isn’t installed by default on Mac OS X Leopard. If you need it, it’s quietly easy to install on Leopard: download MySQL 5.1 for Mac OS X 10.5 (x86_64), launch its setup wizard and edit php.ini to connect through the right mysql socket:
[MySQL] ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = /tmp/mysql.sock [MySQLi] ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysqli.default_socket = /tmp/mysql.sock
A web-server restart is required in order to apply any httpd.conf or php.ini changes. All extension files need to be executable by apache's user.
bzip2
[SHA-1 = 23c6ab73055f639ae16d7342846c657aa13cd02f]
bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression. After you have copied the extension file into right folder, add the following line to your php.ini:
extension = bz2.so
ionCube loader 5.2
[SHA-1 = 0088db3022fb1e7c74e0faef2e88fb5a2a6dbb75]
If you need support to ionCube encoded php files, you can download and copy this extension in the folder /usr/lib/php/extensions/no-debug-non-zts-20060613. This extension has been picked from the package downloadable from ionCube’s web site. I’m sharing it because there’s a lot of confusion on its use...hope to save you some googling! Add the following lines to your php.ini file:
[Zend]
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20060613/ioncube_loader_dar_5.2.so
GD Library
[SHA-1 = 53fe03db4a3a70641575d36226e6c07dccfc36de]
GD Library must be compiled and installed in order to have extension really working on images. Add the following line to your php.ini:
extension = gd.so
Gettext
[SHA-1 = 174034a31169e11b0abdba7686087168032a84bb]
PHP Extension for GNU Gettext utility. Add the following line to your php.ini:
extension = gettext.so
MCrypt
[SHA-1 = f7ead521d9ae354a5f60133f5e5a21018184be22]
This extension is intended as replacements for the old Unix crypt, except that they are under the GPL and support an ever-wider range of algorithms and modes. It’s required by projects like Magento. Please note that you must have Libmcrypt installed. Don’t forget to add the following line to your php.ini:
extension = mcrypt.so
Mhash
[SHA-1 = 2c6d86a3e5cc630c3006d0fe8c2b65c58a5c3f2c]
This extension is an interface to the mhash library. Mhash supports a wide variety of hash algorithms such as MD5, SHA1, GOST, and many others. Add the following line to your php.ini:
extension = mhash.so
PDO MySQL
[SHA-1 = 6850b46aad91f1e9e12a5ef2b220c9e0119cec2a]
This extension enables mysql driver for PDO interface. It has been tested with MySQL 5.1.26 package for Mac OS X 10.5 (x86_64) and requires exact path for socket and app as shown above. As usual, download extension, copy in folder I mention above and add the following line to your php.ini:
extension = pdo_mysql.so
SOAP
[SHA-1 = 1a5bf50f2548082dc7c5a1904340bcb546794fd9]
SOAP is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. The SOAP extension can be used to write SOAP Servers and Clients. It supports subsets of SOAP 1.1, SOAP 1.2 and WSDL 1.1 specifications. Download the extension file and copy it into right folder, then add the following line to your php.ini:
extension = soap.so
ZIP
[SHA-1 = 9f1c6fbdb5d80e687071e03f0a721c8c32af9fd0]
This extension enables you to transparently read or write ZIP compressed archives and the files inside them. Download, copy into the extensions folder and add the following line to your php.ini:
extension = zip.so