Setting up LAMP and PHPUnit on CentOS for staging.
I needing to setup a staging environment that more or less emulates the platform of your deployment system, i needed to setup a LAMP stack with PHPUnit for testing on the target platform.
Using CentOS and help from my good friend Cordoval (you can check out his cutting edge blog at http://www.craftitonline.com) we setup using Apache, PHP and MySQL.
We used the yum package manager to get things up and running:
First we needed to setup php :
$ yum install php
$ yum install php-dom
$ yum install mysql
$ yum install mysql-server
$ yum install mysql-devel
$ chgrp -R mysql /var/lib/mysql
$ chmod -R 770 /var/lib/mysql
$ service mysqld start
With that done, we needed to then setup PEAR:
$ yum install php-pear
Then i followed the guides found here: (http://ulaptech.blogspot.co.uk/2011/07/install-phpunit-in-rhel-centos-or.html)
I will copy the instructions but all credit goes to the link above:
1. Make sure that you’re PEAR is version 1.9.2 or above.
$ pear upgrade pear
2. Discover all channels required.
$ pear channel-discover pear.phpunit.de
$ pear channel-discover pear.symfony-project.com
$ pear channel-discover components.ez.no
3. Install PHPUnit with all the dependencies
$ pear install --force --alldeps channel://pear.php.net/HTTP_Request2-2.0.0RC1
optional, at the time of writing this is beta so I had to force install it
$ pear install --alldeps phpunit/PHPUnit
4. Done. Test PHPUNIT.