Because Mavericks server uses PHP 5.4, any extensions you may have compiled for previous versions of Mac OS X (such as memcache, apc, mcrypt) need to be recompiled and reinstalled.
This post assumes you used MacPorts to compile and install the PHP extensions in question. Here’s how to accomplish the task:
Force MacPorts to update from the terminal:
sudo port -v selfupdate
Next, determine which ports depend on the php5 port:
sudo port dependents php5
After visually confirming you want to get rid of them all, issue this command to uninstall the old versions of those ports:
sudo port uninstall --follow-dependents php5
Do the same for memcached (if you’ve installed it):
sudo port uninstall memcached
Now unload it:
sudo port unload memcached
Compiling the new PHP 5.4 version
Now, we need PHP 5.4 in order to build our extensions. So, let’s install the PHP 5.4 port:
sudo port install php54
Back up your existing /etc/php.ini file if you have one:
sudo cp /etc/php.ini /etc/php.ini.orig
Copy the php.ini file from the new port to your /etc/ directory. Choose the version (development or production) that suits your requirements:
cd /opt/local/etc/php54 sudo cp php.ini-production /etc/php.ini
Duplicate any modifications you made in your original php.ini.orig file in your new /etc/php.ini file.
Compiling new versions of PHP extensions
Now, use MacPorts to download and recompile your PHP extensions:
Pingback: Install memcache and APC on Mavericks Server 3 (Mac OS X 10.9) | Garbage In Garbage Out : Tech Blog
Pingback: Add mcrypt to Mac OS X (Snow Leopard 10.6, Lion 10.7, Mountain Lion 10.8) | Garbage In Garbage Out : Tech Blog
Pingback: Install memcache and APC on Mac OS X Server (snow leopard 10.6, Lion 10.7, Mountain Lion 10.8) | Garbage In Garbage Out : Tech Blog
Pingback: Add mcrypt PHP extension to Mac OS X Mavericks server | Garbage In Garbage Out : Tech Blog
Pingback: Add the ssh2 extension for PHP on Mac OS X Mavericks server | Garbage In Garbage Out : Tech Blog
Pingback: Add Internationalization extension to PHP on Mac OS X 10.9 Mavericks Server | Garbage In Garbage Out : Tech Blog