1. Extract PHP source code, and create directory cubrid under dir ext:
$> tar zxvf php-<version>.tar.gz (or tar jxvf php-<version>.tar.bz2) $> cd php-<version>/ext ext> mkdir cubrid
2. Put the following files in PHP Library into directory cubrid:
cubrid-php> php_cubrid.c php_cubrid.h php_cubrid_version.h config.m4
3. Go to the root directory of PHP source code and update the configuration file:
php-root> ./buildconf --force
Note: When developing a PHP extension, it is strongly recommended that autoconf version 2.13 be installed, despite the newer releases which are available. Version 2.13 is recognized as a common denominator of autoconf availability, usability, and user base. Using later versions will sometimes produce cosmetic differences from the expected output of configure. |
4. Configure the project. Before you run configure, we strongly recommend that you run "./configure –h" to check the configure options.
An example may be like this (we assume that apache2 has been installed in /usr/local):
php-root>./configure --prefix=/usr/local/php -with-cubrid=shared --enable-maintainer-zts --with-apxs2=/usr/local/apache2/bin/apxs
--with-cubrid=shared |
Include CUBRID support |
--enable-maintainer-zts |
Enable thread safety - for code maintainers only |
--with-apxs2=FILE |
Build shared Apache 2.0 Handler module. |
5. Build and install the package. If it was successfully compiled, the cubrid.so file will be created in the /modules directory:
php-root> make; make install
6. Copy php.ini-xxx (In PHP 5.2.x, they are php.ini-dist and php.ini-recommended; In PHP 5.3.x, they are php.ini-development and php.ini-production; choose what you need) file to directory /usr/local/php/lib, and rename it to php.ini.
php-root> cp php.ini- production /usr/local/php/lib/php.ini
7. In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable. For example:
extension_dir = "/usr/local/php/lib/php/extension/no-debug-zts-xxx" extension = cubrid.so
1. Create a test.php file with the following contents:
<?php phpinfo(); ?>
2. Use web browser to visit http://localhost/test.php, and if you see the following contents, the installation is successful.
CBURID |
Value |
Version |
8.3.1.XXXX |