Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Build CUBRID PHP Driver for XAMPP on Mac OS X using CCI Driver

In this tutorial you will learn how to install CUBRID PHP driver using CUBRID CCI driver to be able to use it with XAMPP for Mac OS X. This tutorial is very similar to the original Build CUBRID PHP Driver on Mac OS X using CCI Driver except for that configuration step which is different for XAMPP since XAMPP binaries are universal (x86_64 compatible). For XAMPP we need to build x86 compatible PHP extension.

Download CCI driver

CUBRID PHP driver has a dynamic dependency on CCI driver. We have built a custom CCI driver for Mac users. for XAMPP usage download 32 bit version. Once you download it, extract it to /usr/local/cubrid directory. The following example illustrates how to extract the 32-bit version.

tar zxvf CUBRID-CCI-
sudo mv CUBRID-CCI- /usr/local/cubrid

Once you have moved the files, make sure the CCI library is executable by everyone.

sudo chmod +x /usr/local/cubrid/lib/libcascci.8.dylib

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. For XAMPP, we will use the phpize distributed with its binaries.


Next, configure the build.

  1. Notice the --with-php-config option. For XAMPP, use the php-config file distributed with its binaries.
  2. The --with-cubrid option. This is that same directory where we have extracted CUBRID CCI driver files.
  3. Notice a series of environmental variables set for this configuration. They are important for PHP API compilation for XAMPP. -arch i386 allows the build to be configured for x86 architecture. You need to copy  and paste all of the following commands in one line.

CFLAGS="-arch i386" CCFLAGS="-arch i386" CXXFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --with-cubrid=/usr/local/cubrid/ --with-php-config=/Applications/XAMPP/xamppfiles/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 XAMPP PHP extensions directory. In XAMPP version 1.7.3 for Mac, the extensions directory is located in /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/.

sudo cp modules/ /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/

Now open the php.ini file located in /Applications/XAMPP/xamppfiles/etc/php.ini and add the following line which instructs XAMPP to load CUBRID extension with the next restart.

Done! Now restart XAMPP Apache server to load CUBRID extension.


In your browser visit http://localhost/xampp/phpinfo.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 4597 times
translations en
posted 5 years ago by
updated 5 years ago by
View revisions
Share this article