How long it’s quite easy to setup init.d services on linux boxes, same task on Max OS machines is pretty hard. Especially if you need to run it with root privileges.
Some time ago I bought extremely quiet Shuttle XS35 V2 device to have something “seperate” for my web development work. Right now this awesome fan less device has many purposes. Works as full web dev stack, with Apache, PHP, MySQL, mongoDB, and even Jenkins machine.
Recently I realised that this small ugly device got also WiFi cart into it. Because I’m running out of cables and space in my apartment i figure out, that I could move it easily without plugging into it more cables.
There is a plenty of tutorials how to install PEAR and PHP, but there is always something “missing” in this configuration. So this time, i’m going to “sing the same song again”.
Let’s start – PEAR
curl http://pear.php.net/go-pear.phar > go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
Make sure that you have setup similar to this one (may vary about you current setup):
1. Installation base ($prefix) : /usr/lib/php
2. Temporary directory for processing : /tmp/pear/install
3. Temporary directory for downloads : /tmp/pear/install
4. Binaries directory : /usr/bin
5. PHP code directory ($php_dir) : /usr/lib/php
6. Documentation directory : /usr/lib/php/doc
7. Data directory : /usr/lib/php/data
8. User-modifiable configuration files directory : /usr/lib/php/cfg
9. Public Web Files directory : /usr/lib/php/htdocs
10. Tests directory : /usr/lib/php/tests
11. Name of configuration file : /Users/sjas/.pearrc
Very important part of the process is to properly setup includes path in php.ini, by defualt there is no /etc/php.ini, so you have to create / copy it.:
sudo cp /etc/php.ini.default /etc/php.ini
sudo nano /etc/php.ini
and make sure that you have something like that:
include_path = ".:/php/includes:/usr/lib/php/share/pear"
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover components.ez.no
sudo pear channel-discover pear.symfony-project.com
sudo pear install phpunit/PHPUnit
pear install -a -f pear.phpunit.de/FinderFacade
XDebug for Mac OS
Bonus tip how to install older version of Pear package:
pear uninstall PHP_CodeSniffer
pear installl PHP_CodeSniffer-1.4.8