PHP and PECL Extensions on Snow Leopard
This is a quick post that I could possibly come back and improve later
This is based on something being in a users home dir/sites/ directory.
Although it doesn’t really matter for a cli script
So we have
/Users/gabriel
/Users/gabriel/Sites
/etc/apache2/users/gabriel.conf
is the conf file for the vhost in your user dir which you shouldn’t really have to worry about, but always good to know where it is.
sudo nano /etc/apache2/httpd.conf
uncomment the php line that is found in here, I also uncommented the fastcgi line after it for kicks
sudo apachectl restart
And that’s you sorted for php on apache, note this is php5.3 on apache 2.2.13
For this I’m installing the runkit PECL extension “For all those things you…. probably shouldn’t have been doing anyway….”
We need to install the sex that is xcode, grab the latest one from the Apple Developer Connection website http://developer.apple.com/tools/xcode/
We have svn installed already so grab a copy of it, http://svn.php.net/repository/pecl/runkit/trunk/ is the repo and http://svn.php.net/viewvc/pecl/runkit/trunk/ is the fancy human readable version
svn checkout http://svn.php.net/repository/pecl/runkit/trunk runkit
cd runkit
phpize
./configure
sudo make
sudo make install
and we’re nearly done!
I couldn’t find a default php.ini and a simple phpinfo(); seems to indicate there isn’t one, so we:
sudo cp /etc/php.ini.default /etc/php.ini
sudo nano /etc/php.ini
find the long list of commented out modules
and add
extension=runkit.so
Quit and save and
sudo apachectl restart
you don’t really need todo that since you’re probably using it in cli but it’s fun to do anyway