Configuring the Environment

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;

PHP 5.3 binaries:
You can install VC9 x86 Non Thread Safe or VC9 x86 Thread Safe, and check if the value of system environment variable %PHPRC% is rightly set;

In the VC9 project Properties, under the Linker tree node, select the General node, you can see $(PHPRC) in Additional Library Directories.

PHP 5.3 source code:
Remember to get the source that matches your binary version. After you extract the PHP 5.3 source code, add system environment variable %PHP5_SRC%, and set its value to the path of PHP 5.3 source code.

In the VC9 project Properties, select the General node from 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 header file config.w32.h. You can read the wiki page below to get how to configure it.http://wiki.php.net/internals/windows/stepbystepbuild

Build VC9 Library for PHP 5.3

1. Open VC9 project under directory win, in the Solution Explorer on the left, right click on the php_cubrid project name and select Properties;

2. On the top right corner of the php_cubrid Property Page press Configuration Manager button. In the new window, select the configure you want for Active solution configuration for Configuration in the Project contexts. There are four configurations (Release_TS, Release_NTS, Debug_TS and Debug_NTS). Then close the Configuration Manager;

3. Once you complete the properties modification, press the OK button. Then press F7 to compile;

4. As we have built php_cubrid.dll we have to make PHP recognize it as an extension:

a) Inside PHP installation folder create the new folder called cubrid, and copy php_cubrid.dll to cubrid folder. You can also put php_cubrid.dll in %PHPRC%\ext if this directory exists.
b) In php.ini file set the extension_dir variable and add CUBRID PHP Library to extension variable.