These steps were checked on Windows 7.
It should work fine with any PHP 5.X version and any other W32 platform.
Download and install Apache Server from http://httpd.apache.org/download.cgi. You can also get Apache compiled and optimized with Visual Studio VC9 and other modules (like PHP5 module) from Apache Lounge.
Download and install PHP5 from http://windows.php.net/download/. Remember to download and install according your VC version.
PHP will automatically install itself in to your apache server. If you got Apache from Apache Lounge you may need their PHP module version.
You can verify your install by adding a file in your htdocs directory with the following code:
You can install the latest version of Zorba by downloading the most recent binaries, additionaly you can also compile Zorba from source by following Zorba Build Instructions.
If you are compiling Zorba, you will need also to compile the PHP Wrapper, to do this you besides the Zorba Build Instructions you need to add these three variables to your CMAKE command line:
After adding those lines CMAKE will add automatically the PHP Wrapper project and you will be able to get zorba_api.dll, which is the extension you can use in your php binary installation.
Check Zorba is working by command line:
Copy Zorba extension zorba_api.dll file into your php extensions directory, this extension is located on: Zorba compiled from sources: [ZORBA BUILD DIRECTORY][DEBUG/RELEASE IF VISUAL STUDIO] Zorba installed binaries: [ZORBA INSTALL DIRECTORY]\
this file must be copied to your extensions directory that may be:
Modify your php.ini
Add the following line to php.ini
php.ini extension=zorba_api.dll
In your Zorba directory, locate the files zorba_api_wrapper.php and XQueryProcessor.php, copy them it to your include directory from where php can find it, this location is set on your php.ini file with the name <cope>include_path, i.e.
php.ini ; Windows: "\path1;\path2" include_path = ".;C:\php\include" Restart Apache Http server
Refresh your browser with previous info file: http://localhost/info.php
Check if zorba_api is in the list of php known extensions.
Add the following content in to a file on your htdocs directory:
test.php
Point your browser to http://localhost/test.php and see the result.
For more details on how to use Zorba API in PHP go to Building XQuery-powered applications with PHP and Zorba article by Vikram Vaswani.