Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

php_cubrid_windows_build_guide_2


Compile CUBRID PHP Library with VC6 for PHP 5.3/5.2

Download CUBRID PHP Library, extract it and enter the directory, you will find VC6 project file php_cubrid.dsp. Before you open the project, you should do some preparations.

Configuring the Environment

  • cubrid 2008 R3.1:
    Install CUBRID 2008 R3.1, and make sure the Environment Variable %CUBRID% is defined in your system;
  • Visual C++ 6.0 SP6:
    You should install the VC++ 6.0 SP6;
  • Windows Server Feb. 2003 SDK:
    All official releases or snaps are built using VC6 with SP6 and this SDK, and you’d better compile you extension using this SDK.

If you don’t install this SDK (It seems that you can no longer download it from Microsoft Download Center for free), you can also use VC6’s default settings. But you may see errors when you compile the extension and have to fix them manually.

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

In the VC6 project, you can find $(PHPRC) in Settings->Link->Input->Additional library path


5.JPG
  • PHP 5.3/5.2 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 VC6 project, you can find $(PHP5_SRC) in Settings->C/C++->Preprocessor->Additional include directories


6.JPG

Note: If you build CUBRID PHP Library with PHP 5.3 source code, you need to configure PHP 5.3 on Windows. If you don’t, VC 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 VC6 Library for PHP 5.3/5.2

1. Open VC6 project, in Build menu, select Set Active Configuration. There are four configurations (Win32 Release_TS, Win32 Release, Win32 Debug_TS and Win32 Debug). Choose what you want, then close the Set Active Project Configuration;


7.JPG


8.JPG

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

3. 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.

comments powered by Disqus
Page info
viewed 1257 times
translations en
Author
posted 3 years ago by
hellohuizhang
Contributors
updated 3 years ago by
View revisions
Share this article