Open Source RDBMS - Seamless, Scalable, Stable and Free

English | Login |Register

php_cubrid_linux_build_guide_2


Configuring the Environment

  • cubrid 2008 R4.3:
    Install CUBRID 2008 R4.3, and make sure the Environment Variable %CUBRID% is defined in your system;
  • PHP 5.3/5.4 source code:
    Download PHP source code (PHP 5.3 or 5.4) from PHP.net. When we update this build guide, the latest stable version of PHP 5.3 is 5.3.21, and PHP 5.2 is 5.4.11.
  • Apache2:
    We can use apache2 to test PHP;

Compile PHP Library for CUBRID individually

1. Download PHP Library(http://www.cubrid.org/downloads), extract it and enter the directory. Take CUBRID-PHP5-8.4.3.0001.src.tar.gz for example.

$> tar zxvf CUBRID-PHP5-8.4.3.0001.src.tar.gz;
$> cd RB-8.4.3

2. Run phpize

cubrid-php> /usr/bin/phpize

What is phpize? Where can I get it?

phpize is a shell script to prepare PHP extension for compiling. Typically, when you install PHP, phpize will be automatically installed. If it is not installed on your system, the process of get it is as follows:

1. Download PHP source code, and make sure its version is what you want your PHP extenstion works with. Extract PHP source code, and enter its root directory:

$> tar zxvf php-<version>.tar.gz (or tar jxvf php-<version>.tar.bz2)
$> cd php-<version>

2. Configure the project, and build and install it. You can specify the directory you want install PHP to with configure option --prefix:

php-root> ./configure --prefix=prefix_dir; make; make install

3. Then you can find phpize in prefix_dir/bin.

3. Configure the project. Before you run configure, you'd better run "./configure –h" to see the configure options. For example:

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

4. Build. If it was successfully compiled, the cubrid.so file will be created in the ./modules directory:

cubrid-php> make

5. Copy cubrid.so to the extensions directory in lib/php directory which is located inside PHP root directory (/usr/local/php):

cubrid-php> mkdir /usr/local/php/lib/php/extensions 
cubrid-php> cp modules/cubrid.so /usr/local/php/lib/php/extensions

6. 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/extensions"
extension = cubrid.so

Test CUBRID PHP Library Installation

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.

CUBRID support

enabled

Driver Version

8.4.3.0001

CCI Version

8.4.3

comments powered by Disqus
문서 정보
viewed 842 times
번역 en
작성자
posted 3년 전
hellohuizhang
공헌자
마지막 수정시간 작년
변경 내역 보기
Share this article