I. How To Compile and install
II. Note about Apache

I. How To Compile and install

0. Uninstall PHP
1. Download gnokii 0.6.14 *sources* or later from gnokii.org; compile and install
2. Get PHP 4 *sources* from php.net
3. If you plan to debug this extension then configure PHP using
--enable-debug --enable-experimental-zts
If you plan to use PHP with Apache then add --with-apxs

./configure --with-apxs --enable-debug --enable-experimental-zts --prefix=/usr
make && sudo make install

Compiling this beta version has been tested only after installing
PHP 4 from source with debug options enabled.
Note that this might replace the existant php executable and break your
current install because extensions are searched in a subdirectory of the
source tree, that's why I suggest to uninstall PHP in the first step.

4. Untar the extension sources inside php-x.y.z/ext then configure and compile

cd gnokii
./configure --enable-gnokii
make && sudo make install

5. Test
php -r 'dl("gnokii.so"); gnokii_open(); print_r( gnokii_identify() );'

II. Note about Apache

You need to enable the extension in php.ini adding


in the section "Dynamic Extensions" because you cannot load it
using dl() inside the script in a threaded server.