Chapter 6. PHP Extension

These functions allow you to interact with the FANN library from PHP.

This extension requires the FANN library, version 1.1.0 or later.

This extension supports the same activation functions as the library, a list of which can be found in the Activation Functions section.

6.1. Installation

6.1.1. Using PEAR

The easiest way to install FANN-PHP is to use PEAR- if you have a fairly recent version of PHP installed, simply run pear install fann. Note that if there are no stable releases of FANN-PHP, you may have to specify the URI for the package, which can be obtained from http://pecl.php.net/fann.

If you cannot install FANN-PHP using PEAR, you can try following the (obsolete) instructions at http://www.cs.utexas.edu/users/UTCS/online-docs/php/pear/faq.install-pecl.html.

If you use one of these methods, you'll need to either dl('fann.so') or add it to your php.ini

If you use either of the above methods, you will probably need to be root.

6.1.2. Compiling into PHP

Please only use this method if using the methods outlined in Using PEAR have failed.

If you wish to compile FANN-PHP into PHP itself, you can. First, uncompress the package into the ext subdirectory of your copy of the PHP source code, and rename the directory to ext/fann (from fann-x.x.x).

Next, you must rebuild the configure script- to do so, run ./buildconf from the PHP source directory.

From here on, the procedure is similar to when you built PHP originally- run ./configure with your desired options, plus --with-fann.

Finally, run make and make install. Note that you will probably need to be root for make install to work.

This method may require flex and bison to work- more information can be obtained at http://www.php.net/anoncvs.php


SourceForge.net Logo