2014年12月16日 星期二

Installing mcrypt extension for PHP on OSX Mountain Lion

(download your php version)
$ wget http://www.php.net/get/php-5.3.15.tar.bz2/from/a/mirror $ tar -xvzf php-5.3.15.tar.gz $ cd php-5.3.15/ext/mcrypt

$ phpize
$ ./configure
$ make
$ make test
$ sudo make install 

mcrypt.so is now in your PHP ext dir (/usr/lib/php/extensions/no-debug-non-zts-20090626/ in my case), now you need to add to php.ini as a module

$ vi /etc/php.ini
$ (insert) extension=mcrypt.so

$ sudo apachectl restart

If need to install libmcrypt, please follow below steps:
1. Get libmcrypt 2.5.8 from Sourceforge,  this is direct download link.
2. tar -zxvf libmcrypt-2.5.8.tar.gz
3. cd libmcrypt-2.5.8
4. ./configure
5. make
6. make install

2014年12月15日 星期一

Solved Non-static method PEAR::raiseError() should not be called statically

$pear = new PEAR();
CHANGE "PEAR::raiseError" to $pear->raiseError();

2014年12月10日 星期三

Mac OSX phpunit install

To install via terminal:
$ curl https://phar.phpunit.de/phpunit.phar -o phpunit.phar
$ chmod +x phpunit.phar
$ cp phpunit.phar /usr/local/bin/.
$ mv phpunit.phar /usr/local/bin/phpunit

wibiya widget