Installing CUBRID PHP Driver using PECL


If PECL packager is installed in your system, the installation of CUBRID PHP Driver is straightforward. PECL will download and compile the library for you.

Requirements

To install the PHP Driver using PECL, you need to have CUBRID Database installed in your system since PHP Driver is dependent on CUBRID CCI API.

Installation

Type the following command to install the latest version of CUBRID PHP Driver.

sudo pecl install cubrid

If you need older version of the driver, you can indicate its exact version like:

sudo pecl install cubrid-8.3.0.0005

During the installation you will be prompted to enter "CUBRID base install dir autodetect :". Just to make sure your installation goes smoothly, enter the full path to the directory where you have installed CUBRID. Ex: if CUBRID was installed at /home/cubridtest/CUBRID, then enter /home/cubridtest/CUBRID.

a) If you have Centos 6.0 and above or Fedora 15 and above, then do not edit the php.ini as stated in step b and instead create a file named pdo_cubrid.ini in which you add only the line extension=pdo_cubrid.so. This file has to be placed in the /etc/php.d folder.

b) Edit the php.ini (default location: /etc/php5/apache2/php.ini or /etc/php.ini) and add the following two lines at the end of the file.

[CUBRID]
extension=cubrid.so

To apply the changes, restart your Web Server.

What If I don't have PECL installed?

If you do not have PECL installed, follow these instructions to get it installed in your system.

Ubuntu Instructions

In order to install CUBRID-PHP API on Ubuntu, you will need PHP Development Tools (phpize) and pear packager.

  • Type the following command to install phpize
    sudo apt-get install php5-dev
  • Type the following command to install pear package
    sudo apt-get install php-pear

Then follow the above instructions to install CUBRID PHP Driver.

Fedora/CentOS Instructions

In order to install CUBRID-PHP API on Fedora/CentOS, you will need PHP PEAR and phpize packages.

  • Install phpize. Remember that php-dev should be either PHP 5.2.x compatible or PHP 5.3.x since CUBRID-PHP Extension is developed for these PHP versions. If your Linux distribution installs earlier version, you need to update it. 
    yum install php-devel 
  • Download PEAR package
    wget http://pear.php.net/go-pear.phar 
  • Run PEAR package with PHP: 
    php go-pear.phar

What's Next?

  • Refer to CUBRID PHP Tutorials

Comments: 3

For 8.4.1 on CentOS 6, if you are getting

/usr/bin/ld: cannot find -lgcrypt

collect2: ld returned 1 exit status

make: *** [cubrid.la] Error 1



Make sure you install: libgcrypt-devel and ncurses-devel.

Reply
commented 3 months ago
cristiroma
*.136.150.117

You can check correct installation by using $>php -r "echo phpinfo()" and getting the following results. That warning means that you have to set in php.ini the date.timezone parameter


....

CUBRID


CUBRID support => enabled

Client API version => 8.4.1.0001PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Helsinki' for 'EET/2.0/no DST' instead in Command line code on line 1


Supported CUBRID server => 8.4.0



Reply
commented 3 months ago
cristiroma
*.136.150.117

The correct way to install the driver on RHEL like distros (Fedora, RHEL, CentOS) is to add a new file in /etc/php.d/cubrid.ini with a single line extension=cubrid.so and NOT edit the php.ini


Reply
commented 3 months ago
cristiroma
*.136.150.117

Trackback '2'

CUBRID PHP Driver Installation Instructions

There are several ways to install CUBRID PHP Driver. Below you will see instructions for each of them. [Installing CUBRID PHP Driver using PECL] (Linux) [Inst...

3 months ago

CUBRID PHP Driver Installation Instructions

There are several ways to install CUBRID PHP Driver. Below you will see instructions for each of them. [Installing CUBRID PHP Driver using PECL] (Linux) [Inst...

3 months ago

Page info
viewed 519 times
translations en
Author
posted 4 months ago by
CUBRID
Contributors
updated 2 months ago by
View revisions
Share this article