Open Source RDBMS - Seamless, Scalable, Stable and Free

English | Login |Register

CUBRID PHP Driver Build Guide for Windows x64

This article will guide you through the steps you need to follow to build Windows x64 CUBRID PHP Driver with PHP 5.3 and VC9. If you are looking for how to build x86 PHP Driver, see sibling article CUBRID PHP API Build Guide.

x64 PHP

We do not provide Windows x64 CUBRID PHP driver, mainly because there is no official Windows x64 PHP on windows.php.net (only x86 version are available). But sometimes you need x64 PHP. In that case you can build it from source codes, best of all, some guys have already done this (see http://www.anindya.com/).

You can find the "supported compilers to build PHP on Windows" at https://wiki.php.net/internals/windows/compiler. You can see that both VC++ 8 (2005) and VC++9 (2008 SP1 only) can be used to build 64bit PHP. Prior to Visual C++ 2005, the Platform SDK was the only way for programmers to build 64-bit Windows applications. This is why you cannot build x64 PHP using VC++ 6 (sp6), but to use the Windows Server Feb. 2003 SDK to build it.

x64 Apache

There is no official Windows x64 Apache too. You can get vc9 x86 version Apache at http://www.apachelounge.com/, but there is no x64 version. Instead, you can use IIS as your windows server on 64-bit Windows. If you really need vc9 x64 Apache, you can find it at http://www.anindya.com/.

Building x64 PHP Driver

The following contents will give instructions for building x64 driver. We will not talk much about building Windows x64 PHP, because you can find the solutions following the above given links.

Prepare the environment

  • CUBRID x64 version:
    Install the latest version of CUBRID x64 version, and make sure the Environment Variable %CUBRID% is defined in your system;
  • Visual Studio 2008:
    You can alternately use the free Visual C++ Express Edition or the VC++ 9 compiler in the Windows SDK v6.1 if you're a Makefile master;
  • SDK 6.1:
    If you are using VC9, you need Windows SDK for Windows Server 2008 and .NET Framework 3.5 (also known as the SDK 6.1);
  • PHP 5.3 x64 binaries:
    You can build your own VC9 x64 PHP with SDK 6.1, or you can get it at http://www.anindya.com/, both VC9 x64 Non Thread Safe and VC9 x64 Thread Safe are available. After you have installed it, please check if the value of system environment variable %PHPRC% is correctly set;
  • PHP 5.3 source code:
    Remember to get the src package that matches your binary version. After you extract the PHP 5.3 src, add system environment variable %PHP5_SRC%, and set its value to the path of PHP 5.3 src. In the VC9 project Properties, select the General node in C/C++ tree node. You can see $(PHP5_SRC) in Additional Include Directories.

    Note: You do not need to build PHP 5.3 from source, but you do need to configure it. If you don't, VC9 will tell you that it can't find the header file config.w32.h. To configure it, you also need some additional tools such as flex, bison and so on. Read https://wiki.php.net/internals/windows/stepbystepbuild for more detailed information.

Configure PHP 5.3

After you have installed SDK 6.1, click the CMD Shell shortcut under the Microsoft Windows SDK v6.1 folder under the Start menu to start a cmd shell.

cmd.png

Run setenv /x64 /release.

setenv.png

Then enter PHP 5.3 source code directory in the cmd, and run buildconf to generate the configure.js file.

cd-php-dir.png

Otherwise, you can also double-click the buildconf.bat file.

buildconf.png

Then run configure to configure the PHP project.

configure.png

nmake.png

Build VC9 x64 Driver for PHP 5.3

Open VC9 project under directory win. In the Solution Explorer on the left, right click on the php_cubrid project name and select Properties. The following window should pop up. On the top right corner of the php_cubrid Property Page, click Configuration Manager.

vc9-property-pages.png

In the new window under Active solution configuration, there are four configurations (Release_TS, Release_NTS, Debug_TS and Debug_NTS). We need to create a new one for our x64 build. For this reason, select the <New> option.

configuration-manager-new.png

In the new window, input the configuration name (e.g., Release_TS_x64). For the copy setting from choose the corresponding x86 configuration, in our case Release_TS. Then click "OK".

new-solution-configuration.png

In the same Configuration Manager window, click the dropdown box under the Platform header label. If there is x64, choose it, otherwise choose <New…>.

configuration-manager-new-platform.png

In the new window, choose x64 option for New platform. Press OK and close the Configuration Manager.

new-project-platform.png

In php_cubrid Property Pages window, select the Preprocessor node under the C/C++ tree. In Preprocessor Definitions, delete _USE_32BIT_TIME_T. Then click OK to close the window.

prooerty-pages-preprocessor.png

Then press F7 to compile, and you will get the x64 PHP driver for CUBRID DBMS.

See also

CUBRID PHP API Installer - Install Wizard

The CUBRID PHP API Installer is a Windows Installer which automatically detects the CUBRID and PHP version, and installs the proper driver for...

Install CUBRID with AutoSet

AutoSet is a software bundle for Windows, which provides seamless installation of Apache, PHP, MySQL, CUBRID, and Subversion. It is distributed und...

CUBRID PDO Driver Tutorial

The scope of this tutorial is to introduce the CUBRID PDO Driver, which implements the PHP Data Objects (PDO) interface.

Using Ruby Active Record with CUBRID

This tutorial will explain how to use Ruby Active Record Adapter to work with CUBRID Database. Active Record is compatible with most database syste...




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: