<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
    <channel>
        <title>CUBRID PHP Driver Build Guide for Windows x64</title>
        <link>http://www.cubrid.org/?mid=php_api_build_guide_win64</link>
        <description>CUBRID PHP Driver Build Guide for Windows x64</description>
        <language>en</language>
        <pubDate>Wed, 20 Apr 2011 08:17:58 -0800</pubDate>
        <lastBuildDate>Tue, 27 Sep 2011 06:12:43 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>CUBRID PHP Driver Build Guide for Windows x64</title>
            <dc:creator>admin</dc:creator>
            <link>http://www.cubrid.org/php_api_build_guide_win64</link>
            <guid isPermaLink="true">http://www.cubrid.org/php_api_build_guide_win64</guid>
                                    <description><![CDATA[<h1>CUBRID PHP Driver Build Guide for Windows x64</h1>

<div class="contents-table"></div>

<p>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 <a href="/php_api_build_guide">CUBRID PHP API Build Guide</a>.</p>

<h2>x64 PHP</h2>

<p>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 <a href="http://www.anindya.com/" target="_blank">http://www.anindya.com/</a>).</p>
 
<p>You can find the "supported compilers to build PHP on Windows" at <a href="https://wiki.php.net/internals/windows/compiler" target="_blank">https://wiki.php.net/internals/windows/compiler</a>. 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.</p>

<h2>x64 Apache</h2>

<p>There is no official Windows x64 Apache too. You can get vc9 x86 version Apache at <a href="http://www.apachelounge.com/" target="_blank">http://www.apachelounge.com/</a>, 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 <a href="http://www.anindya.com/">http://www.anindya.com/</a>.</p>

<h2>Building x64 PHP Driver</h2>

<p>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.</p>

<h3>Prepare the environment</h3>

<ul>
	<li><b>CUBRID x64 version</b>:<br />Install the latest version of CUBRID x64 version, and make sure the Environment Variable <b>%CUBRID%</b> is defined in your system;</li>
	<li><b>Visual Studio 2008</b>:<br />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;</li>
	<li><b>SDK 6.1</b>:<br />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);</li>
	<li><b>PHP 5.3 x64 binaries</b>:<br />You can build your own VC9 x64 PHP with SDK 6.1, or you can get it at <a href="http://www.anindya.com/">http://www.anindya.com/</a>, 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 <b>%PHPRC%</b> is correctly set;</li>
	<li><b>PHP 5.3 source code</b>:<br />Remember to get the src package that matches your binary version. After you extract the PHP 5.3 src, add system environment variable <b>%PHP5_SRC%</b>, and set its value to the path of <b>PHP 5.3 src</b>. In the VC9 project <code class="menu">Properties</code>, select the <code class="menu">General</code> node in C/C++ tree node. You can see <b>$(PHP5_SRC)</b> in <code class="menu">Additional Include Directories</code>.
	<p class="important"><b>Note:</b> 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 <i>can't find the header file config.w32.h</i>. To configure it, you also need some additional tools such as flex, bison and so on. Read <a href="https://wiki.php.net/internals/windows/stepbystepbuild">https://wiki.php.net/internals/windows/stepbystepbuild</a> for more detailed information.</p>
</li>
</ul>

<h3>Configure PHP 5.3</h3>

<p>After you have installed SDK 6.1, click the <code class="menu">CMD Shell</code> shortcut under the <code class="menu">Microsoft Windows SDK v6.1</code> folder under the Start menu to start a cmd shell.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/cmd.png" alt="cmd.png" width="411" height="475" editor_component="image_link"/></p>

<p>Run <code class="cmd">setenv /x64 /release</code>.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/setenv.png" alt="setenv.png" width="677" height="343" editor_component="image_link"/></p>

<p>Then enter PHP 5.3 source code directory in the cmd, and run <code class="cmd">buildconf</code> to generate the <b>configure.js</b> file.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/cd-php-dir.png" alt="cd-php-dir.png" width="677" height="343" editor_component="image_link"/></p>

<p>Otherwise, you can also double-click the buildconf.bat file.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/buildconf.png" alt="buildconf.png" width="776" height="622" editor_component="image_link"/></p>

<p>Then run <code class="cmd">configure</code> to configure the PHP project.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/configure.png" alt="configure.png" width="677" height="343" editor_component="image_link"/></p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/nmake.png" alt="nmake.png" width="677" height="343" editor_component="image_link"/></p>

<p>Build VC9 x64 Driver for PHP 5.3</p>

<p>Open VC9 project under directory <b>win</b>. In the <code class="menu">Solution Explorer</code> on the left, right click on the <b>php_cubrid</b> project name and select <code class="menu">Properties</code>. The following window should pop up. On the top right corner of the php_cubrid Property Page, click <code class="menu">Configuration Manager</code>.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/vc9-property-pages.png" alt="vc9-property-pages.png" width="759" height="531" editor_component="image_link"/></p>

<p>In the new window under <code class="menu">Active solution configuration</code>, there are four configurations (<i>Release_TS</i>, <i>Release_NTS</i>, <i>Debug_TS</i> and <i>Debug_NTS</i>). We need to create a new one for our x64 build. For this reason, select the <b>&lt;New&gt;</b> option.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/configuration-manager-new.png" alt="configuration-manager-new.png" width="716" height="449" editor_component="image_link"/></p>

<p>In the new window, input the configuration <b>name</b> (e.g., <b>Release_TS_x64</b>). For the <code class="menu">copy setting from</code> choose the corresponding x86 configuration, in our case <b>Release_TS</b>. Then click "OK".</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/new-solution-configuration.png" alt="new-solution-configuration.png" width="437" height="231" editor_component="image_link"/></p>

<p>In the same <code class="menu">Configuration Manager</code> window, click the dropdown box under the <b>Platform</b> header label. If there is x64, choose it, otherwise choose <b>&lt;New…&gt;</b>.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/configuration-manager-new-platform.png" alt="configuration-manager-new-platform.png" width="716" height="449" editor_component="image_link"/></p>

<p>In the new window, choose <b>x64</b> option for <code class="menu">New platform</code>. Press <code class="menu">OK</code> and close the Configuration Manager.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/new-project-platform.png" alt="new-project-platform.png" width="350" height="231" editor_component="image_link"/></p>

<p>In <b>php_cubrid Property Pages</b> window, select the <code class="menu">Preprocessor</code> node under the <code class="menu">C/C++</code> tree. In <code class="menu">Preprocessor Definitions</code>, delete <b>_USE_32BIT_TIME_T</b>. Then click <code class="menu">OK</code> to close the window.</p>

<p><img src="http://www.cubrid.org/files/attach/images/49/041/159/prooerty-pages-preprocessor.png" alt="prooerty-pages-preprocessor.png" width="759" height="531" editor_component="image_link"/></p>

<p>Then press F7 to compile, and you will get the x64 PHP driver for CUBRID DBMS.</p>]]></description>
                        <pubDate>Wed, 20 Apr 2011 07:18:44 -0800</pubDate>
                        <category>php</category>
                        <category>api</category>
                        <category>windows</category>
                                </item>
            </channel>
</rss>
