Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Build CUBRID PHP Driver on Mac OS X using CCI Driver

In this tutorial you will learn how to install CUBRID PHP driver on Mac OS X using CUBRID CCI driver.

Download CCI driver

CUBRID PHP driver has a dynamic dependency on CCI driver. We have built a custom CCI driver for Mac users. You can download either 64 or 32 bit version. Once you download it, you need to copy the contents of the /lib directory /usr/lib and the contents of /include directory into /usr/include. The following example illustrates how to extract a 64-bit version.

tar zxvf CUBRID-CCI-
sudo cp CUBRID-CCI-* /usr/lib
sudo cp CUBRID-CCI-* /usr/include

Download and Compile PHP driver

First, download the source code of the latest version of CUBRID PHP API from PECL repository. Then extract it. Below is the example which illustrates how to extract the source code of PHP API version

tar zxvf CUBRID-

Now, run phpize inside CUBRID- source code directory to prepare CUBRID PHP API extension for compilation.


Next, configure the build.

  1. Notice the --with-php-config option. Make sure you use the correct one.
    1. In our case we have installed PHP using Macports which usually installs packages to /opt/local/ directory. So we used the php-config distributed by Macports.
    2. However, if you use the default PHP engine distributed by Apple, the php-config file may be located in /usr/bin/php-config.
    3. Or if you use XAMPP, the php-config file can be in XAMPP/xamppfiles/bin/php-config.
  2. The --with-cubrid option. This is that same directory where we have extracted CUBRID CCI driver files.

./configure --with-cubrid=/usr --with-php-config=/opt/local/bin/php-config

Finally, make it happen. If it was successfully compiled, the file will be created under the ./modules directory:


Configure php.ini

Copy the compiled extension to you PHP extensions directory. If you do not know where you PHP extensions directory is located, you can execute that same php-config file which will tell you the exact location of you PHP extensions. In our case, it is in /opt/local/lib/php/extensions/no-debug-non-zts-20090626 directory.

sudo cp modules/ /opt/local/lib/php/extensions/no-debug-non-zts-20090626/

Now find the php.ini file and add the following line which instructs your Web server or FastCGI Process Manager to load CUBRID extension with the next restart.

Done! Now restart your Web server to load CUBRID extension.


Create a simple test.php file with the following contents:

<?php phpinfo(); ?>

In your browser visit http://localhost/test.php. Search for "CUBRID". You should see entries like Version, CCI Version, and CUBRID Version.

If you have any questions, please ask them at our Q&A site. If any issues with installation, post on our forum.

comments powered by Disqus
Page info
viewed 4816 times
translations en
posted 5 years ago by
updated 5 years ago by
View revisions
Share this article