In this tutorial you will learn how to install CUBRID PHP driver on Mac OS X using CUBRID 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-220.127.116.1109-x64.macosx.tar.gz sudo cp CUBRID-CCI-18.104.22.16809-x64/lib/* /usr/lib sudo cp CUBRID-CCI-22.214.171.12409-x64/include/* /usr/include
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 8.4.1.003.
tar zxvf CUBRID-8.4.1.0003.tgz
Now, run phpize inside CUBRID-8.4.1.0003 source code directory to prepare CUBRID PHP API extension for compilation.
cd CUBRID-8.4.1.0003 phpize
Next, configure the build.
./configure --with-cubrid=/usr --with-php-config=/opt/local/bin/php-config
Finally, make it happen. If it was successfully compiled, the cubrid.so file will be created under the ./modules directory:
Copy the compiled cubrid.so 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/cubrid.so /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.