For those of you doing technical analysis, Anatoliy Belsky has ported the comprehensive Technical Analysis Library to PHP as a PECL extension. As it is a work in progress, the pecl extension broke during install. Here’s the bug report that describes the error in more detail : https://bugs.php.net/bug.php?id=63511 . Anatoly has fixed this in the trunk, but a newer, stable release it not out yet.
So until then, here’s a stop-gap measure to get it to work. The examples are specific to Ubuntu, but you’ll get the gist of it and adapt.
- Download and extract the pecl extension
wget http://pecl.php.net/get/trader-0.3.0.tgz;
tar xzf trader-0.3.0.tgz; - Edit trader-0.3.0/trader.c, and replace “PHP_FE_END” with “{ NULL, NULL, NULL, 0, 0 }” on line 1225.
- Now install this PECL extension manually:
cd trader-0.3.0
phpize
./configure
make
make install
- Finally, enable the extension in PHP :
sudo echo "extension=trader.so" > /etc/php5/conf.d/trader.ini - And check
php -m | grep trader
You’ll need PHP 5.3.15 and above for this to install.