Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox
Views
PHP and Ingres on OpenVMS with CSWS PHP 2.0
From Ingres Community Wiki
Contents |
Introduction
In 2009 HP released an update for the CSWS PHP providing support for PHP 5.6.0. This document updates the steps needed to build the Ingres PHP driver on OpenVMS.
Getting Setup
Links
Apache + PHP from HP
- http://h71000.www7.hp.com/openvms/products/ips/apache/csws_source.html - Source code for Apache and PHP
- http://h71000.www7.hp.com/openvms/products/ips/apache/csws_download.html - Apache Binary
- http://h71000.www7.hp.com/openvms/products/ips/apache/csws_doc.html - Apache doc
- http://h71000.www7.hp.com/openvms/products/ips/apache/csws_php_relnotes.html - PHP doc
Additional tools used
- http://www.crinoid.com/utils/ - GNU Patch and Diff
- SVNkit - Used for downloading the source code for the PHP Ingres extension
- C compiler/Linker
Setting up the build environment
- Apache and the PHP products must be installed. See the links at the top for info on where to download them. Use the documentation provided, to install the products.
- Download the source archive for PHP and Apache. Whilst the source does not need to be built the header files are required to build the PHP extension.
- Follow the instructions at http://h71000.www7.hp.com/openvms/products/ips/apache/csws_source.html, for details how to download and extract the source.
- For the purposes of the work carried out at Ingres the files were extracted to
CLUS_DGA500:[GRANT.SRC]. You will need to define your own concealed root logical pointing at the target for extraction or extract to the root directory of any ODS-5 enabled disk.
- Install the SVN and GNU Patch utilities
- SVN is used to get the source code, alternatively send an email to grantc@php.net to get a ZIP/BCK/.... of the current source. See the links above to get this utility
- GNU Patch is used to patch the source code provided by HP as well as changes needed for the Ingres PHP extension. See the links above to get this utility
Patch the PHP sources
Whilst we do not need to build PHP, we need its header files to compile the Ingres extension. The following unified diff can be used to update the relevant header file.
--- php_root:[win32]time.h;1 Tue Feb 18 08:34:52 2003
+++ php_root:[win32]time.h;2 Tue Jul 14 12:38:53 2009
@@ -23,10 +23,12 @@
};
+#ifndef __VMS
struct itimerval {
struct timeval it_interval; /* next value */
struct timeval it_value; /* current value */
};
+#endif
#define ITIMER_REAL 0 /*generates sigalrm */
#define ITIMER_VIRTUAL 1 /*generates sigvtalrm */
Building the Ingres PHP extension
The following outlines the steps needed to build the Ingres PHP extension without needing to build PHP from the source provided by HP.
Fetch the Ingres PHP source
The source code for the Ingres PECL extension uses SVN for its source code repository. In order to retrieve the source code an SVN client must be used.
Using the SVNkit jsvn client (see above) check out the source code:
jsvn checkout http://svn.php.net/repository/pecl/ingres/trunk ingres
You should see something like:
$ jsvn checkout http://svn.php.net/repository/pecl/ingres/trunk ingres A ingres/config.w32 A ingres/convertUTF.c A ingres/php_ingres.h A ingres/config.m4 A ingres/convertUTF.h A ingres/CHANGELOG A ingres/INGRES.OPT A ingres/package.xml A ingres/CREDITS A ingres/README A ingres/README.html A ingres/README.VMS A ingres/tests A ingres/tests/test_016.phpt A ingres/tests/test_034.phpt . . . A ingres/tests/test_050.phpt A ingres/tests/test_024.phpt A ingres/tests/test_006.phpt A ingres/tests/test_042.phpt A ingres/TODO A ingres/ingres.ini A ingres/php_ingres2.h A ingres/ingres.c A ingres/ingres.dsp A ingres/BUILD.COM A ingres/ingres.h U ingres
Building the Driver
Compiling the driver requires the following logicals :
DEFINE /EXEC/TRANS=CONC -
PHP_ROOT DEVICE:[DIR.OF.BUILD.PHP.ALPHA-CSWS_PHP-V0103-ECO-1.]
DEFINE PHP_INCLUDES -
PHP_ROOT:[000000...], DEVICE:[DIR.OF.BUILD.APL.ALPHA-V1_2.PORTLIB]
Note that device and directories should be changed to the location that you extracted the HP Apache sources in to.
To build the Ingres extension, execute the BUILD.COM DCL script from the Ingres driver source directory.
Build Output
In the example below the Ingres PECL source is contained within DISK:[GRANT.SRC.SVN.PECL.INGRES].
$ SET DEF DISK:[GRANT.SRC.SVN.PECL.INGRES] $ @build.com Compiling convertUTF.c Compiling ingres.c %LIBRAR-S-INSERTED, module CONVERTUTF inserted in DISK:[grant.SRC.SVN.PECL.ingres]LIBINGRES.OLB;1 %LIBRAR-S-INSERTED, module INGRES inserted in DISK:[grant.SRC.SVN.PECL.ingres]LIBINGRES.OLB;1 Linking shared image PHP_INGRES.EXE
Installing the module
To install the module, copy PHP_INGRES.EXE to APACHE$COMMON:[PHP.EXTENSIONS]:
COPY PHP_INGRES.EXE APACHE$COMMON:[PHP.EXTENSIONS]
Add the following line to APACHE$COMMON:[PHP]PHP.INI:
extension=php_ingres.exe
If the Apache CSWS server is still running you will need to restart it:
@SYS$STARTUP:APACHE$SHUTDOWN.COM @SYS$STARTUP:APACHE$STARTUP.COM
Testing the module
Verify the module is loaded either via the URL http://vmsmachine/php/php_info.php or by executing the following:
$ @APACHE$COMMON:[000000]php_setup.com ! only needs to be executed once $ php -m [PHP Modules] ingres standard [Zend Modules] $
Categories: DBMSDrivers | PHP | OpenVMS | Articles

