Product Documentation

FairCom SQL for PHP

Previous Topic

Next Topic

Compile the SQL PHP 5 Extension (Linux/Unix)

The following procedures in this section are used to compile the c-tree PHP native driver:

Requirement:

  • PHP4 or PHP5 development package. This contains the files needed to build PHP extensions.
    To install on CentOS, use: yum install php-devel
    To install on Ubuntu, use: apt-get install php5-dev
  • Perl
  • Autoconf
  • Automake
  • GNU m4
  • C++ Compiler

Step 1: Create Configuration Script

Move to the drivers/php.sql/src directory under your FairCom product installation directory.

Run the phpize command to create the configuration script based on the contents of the "config.m4" file:

phpize

Step 2: Configure and Build

Run the configure script to create the makefile containing the instructions to build the FairCom DB PHP extension with the original PHP driver:

./configure

In the text that is printed, you should see the following line:

checking whether to enable c-tree SQL support... yes, shared

Build FairCom DB PHP extension using make. Note that if you change versions of PHP, you should do a make clean first, before doing make:

make

It should say “Build complete” when done. The extension will be created in the modules folder: drivers/php.sql/src/modules/ctsql.so

Step 3: Install the Extension

Install the FairCom DB PHP extension into your PHP installation extensions directory by running the following command:

sudo make install

If the folder extension was successfully installed, you should see the following:

Installing shared extensions: /usr/lib/php5/20121212/

Be sure the ctsql.so file has the same permissions as the other .so files in the install folder.

Note: Make sure php.ini is configured to load extensions from the PHP installation extensions directory. This is described in the “Configure PHP 5” section (above).

Note: If you have a configure script with installed Autotools, follow these steps:

> libtoolize
> aclocal
> autoreconf -i
> phpize
> ./configure --with-ctsql

TOCIndex