Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 156
Language: English
Group categories:
Computers > Software
More group info »
Recent pages and files
Building the extension on Windows    

STOP: It's really much much easier to build the extension on *IX than on Windows. That's because on Windows it's a prerequisite for building a PHP extension that you can build PHP itself from source. On *IX all you need is a working PHP environment, and the process is well-documented. If you already build PHP from source on Windows,  then you probably won't need these instructions. But if you don't, and want to give it a go ...

Building PHP and the extension on Windows

We run SCA/SDO development in a branch in the SDO CVS directories because there is an automated process that builds each PECL extension for the Windows environment so that people can download the dll's without having to build them. The automated process takes the code from HEAD. Now if we were to develop in HEAD we would either be breaking that automated build or introducing new functionality into the dlls that people are downloading before it's ready to be released. So you now know why we develop in a branch but this doesn't help you get a working build of the branch on your Windows PC. Here's what I do...

Get a compiler that will compile C++

I'm using Visual Studio.net V7 but it appears from the PHP web site that the free visual studio express will do the job (although I've not tried it). You need to go and install a compiler and then ensure that you environment has all of the correct environment variables set. On Visual Studio express it will be something like

C:\vcexpress2005\VC\bin\vcvars32.bat

Take the latest complete PHP source code release (I'm using 5.2.1) [1]

Build the source into a working PHP executable using the documented instructions [2]

Test some sample scripts to make sure it works

Now you have a working PHP system against which you can build our PECL extension. The SDO part of SCA_SDO contains some C++ code so this needs to be included in the PHP build process.

Get the source code for SCA_SDO into the right place to compile

From the previous steps you will have the following directory structure 

<MyDir>/
   bindlib_w32
   php-5.2.1
   win32build

You need to create a new directory (<MyDir>/pecl). This has to be directly under <MyDir> and will hold the source for any PECL extensions you choose to compile. To hold sdo create a new directory (<MyDir>/pecl/sdo). Go to this directory and check out the SCA_SDO source code.

There is a page in the documentation that describes how to access CVS anonymously [3]. You will of course need to get yourself set up with a CVS client (I used the CVS client in Eclipse) but there are plenty of alternatives. Also you will need to go get SCA_SDO and not php. A command something like the following should do the trick.

cvs -d :pserver:cvsread@cvs.php.net:/repository/pecl/sdo checkout <current-development-branch> /pecl/sdo

You'll need to substitute the name of the current development branch. You'll find this in a file called DEV_BRANCH in the root directory. (But at this point you haven't checked the code out! Browse to http://cvs.php.net/viewvc.cgi/pecl/sdo/DEV_BRANCH?view=markup to find it). This name will change with each release.

You will have to convert this into whatever form your CVS client requires.

Get dependencies 

The C++ code in SDO depends on libxml2 which in turn depends on iconv and zlib. Our docs [4] describe this dependency and point off to the libxml site. This in turn points off to [5] for windows binaries.

You will also need libcurl if you want to get the jsonrpc and xmlrpc support to work but you can leave it out in the first instance.

Configure PHP build

Having got all of this together you need to configure the PHP build to include the sdo extension. You do this by repeating the
buildconf and configure process from the first step. This time round though you need to tell configure about SDO and its dependencies. Here's the configure line I use on Windows:

cscript configure.js --with-extra-includes=c:\win32build\include;
c:\libxml2-2.6.26.threads\include;
c:\iconv-1.9.1.win32\include;
c:\libcurl-7.15.4-nossl\include
--with-extra-libs=c:\win32build\lib;
c:\libxml2-2.6.26.threads\lib;
c:\iconv-1.9.1.win32\lib;
c:\libcurl-7.15.4-nossl\lib
--enable-debug
--enable-sdo=shared
--enable-soap
--with-curl=C:\simon\apps\libcurl-7.15.4-nossl
--with-xmlrpc
Note. The line breaks I have put in here are for clarity and the command will not work with line breaks on windows. You can miss out the curl bits if you don't have that yet.

During the nmake stage of the build process the sdo files should now be built and packaged as a dll called php_sdo.dll in the php-5.2.1/Debug_TS directory. Note that I turned debug on in the configure step hence this directory name.

Configure the PHP runtime to pick up the sdo extension

You have to tell PHP to use the sdo extension by adding some information to the php.ini file. Assuming php.ini is in the directory
php-5.2.1/Debug_TS you need to set the following:

extension_dir="./"
extension=php_sdo.dll
include_path=".;\<MyDir>\pecl\sdo"

Having done all of this sdo should be configured to run in PHP. If you type php -m you should see "sdo" in the module list.

References

[1] http://www.php.net/downloads.php
[2] http://www.php.net/manual/en/install.windows.building.php
[3] http://www.php.net/anoncvs.php
[4] http://www.php.net/sdo/
[5] http://www.zlatkovic.com/libxml.en.html 

 

Version: 
Latest 3 messages about this page (7 total) - view full discussion
May 15 2007 by cem
How to find the current development branch
Apr 27 2007 by simonsl...@googlemail.com
I think at the moment they are just friends :-) If, as some point, we
were to move sca extension code into the package them maybe we would
also have a sca.so/php_sca.dll. For example, the tuscany C++
integration code may be kmore generally useful in terms of supporting
some kind of default binding for SCA . In that case I guess we would
Apr 27 2007 by cem
Indeed the package is called SCA_SDO. But currently the extension is
sdo: either sdo.so or php_sdo.dll. My concern is that if we start
calling it the SCA_SDO extension, people will expect a SCA_SDO.so and
be confused. And it does also raise the questions of possible
migration of some SCA function to an extension in the future, and
4 more messages »
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google