forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Building a phpmysql 4.x client
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> MySQL for OpenVMS
View previous topic :: View next topic  
Author Message
Martin Borgman



Joined: 02 Apr 2006
Posts: 5
Location: Netherlands

PostPosted: Mon Apr 03, 2006 9:06 pm    Post subject: Building a phpmysql 4.x client Reply with quote

How do I build a phpmysql 4.x client using the HP supplied Apache and mod_php sources?
_________________
Martin Borgman
OpenOffice.org On OpenVMS porting group.
www.oooovms.dyndns.org
Back to top
View user's profile Send private message Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Tue Apr 04, 2006 9:59 am    Post subject: How to build php interface for MySQL Reply with quote

I have used something like the that:

DCL procedure build.com:
Code:

$ define ext dev:[php.ALPHA-CSWS_PHP-V0102.ext]
$ define regex dev:[php.ALPHA-CSWS_PHP-V0102.regex]
$ define main  dev:[jphp.ALPHA-CSWS_PHP-V0102.main]
$ define TSRM dev:[php.ALPHA-CSWS_PHP-V0102.TSRM]
$ define PHPINC dev:[php.ALPHA-CSWS_PHP-V0102.main]
$ define PHPINC2 dev:[php.ALPHA-CSWS_PHP-V0102]
$ define PHPTSRM dev:[php.ALPHA-CSWS_PHP-V0102.TSRM]
$ define PHPZEND dev:[php.ALPHA-CSWS_PHP-V0102.zend]
$ cc php_mysql/float=ieee -
    /incl=(phpinc2,phpinc,phpzend,phptsrm,mysql_root:[include])/name=short
$ define mysqlclient MYSQL_ROOT:[VMS.LIB]mysqlclient_upper.olb
$ link/share php_mysql.obj, MYSQL-V0102-.OPT /opt


Linker option file MYSQL-V0102-.OPT:
Code:

!
! Image Ident
!
IDENTIFICATION="MYSQL V1.3"             ! VMS port version
BUILD_IDENT="PHP V4.3.2"                ! PHP release build
!
! Shareables
!
PHPSHR/Share                            ! PHP Shareable
mysqlclient/lib
OPENSSL097E_LIBSSL_SHR32/share
OPENSSL097E_LIBCRYPTO_SHR32/share
LIBZ_SHR32/share
!
! symbol vector detailing the globals exported by the shareable image.
!
symbol_vector=(get_module=PROCEDURE)


Update the various paths tro match your environment.

Jean-François
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin Borgman



Joined: 02 Apr 2006
Posts: 5
Location: Netherlands

PostPosted: Wed Apr 05, 2006 4:45 pm    Post subject: Reply with quote

Thank you Jean-François,

These two files were a great starting point.
I managed to build a CWS-PHP v1.3 (PHP 4.3.10) MySQL 4.1.14 client on OpenVMS 8.3 EFT.
I can't write anything about the 8.3 specifics, but I will try to do the same on an 8.2 system to document the issues with CWS-PHP v1.3.
_________________
Martin Borgman
OpenOffice.org On OpenVMS porting group.
www.oooovms.dyndns.org
Back to top
View user's profile Send private message Visit poster's website
Martin Borgman



Joined: 02 Apr 2006
Posts: 5
Location: Netherlands

PostPosted: Wed Apr 05, 2006 5:32 pm    Post subject: Reply with quote

By the way, what is the difference between mysqlclient_upper.olb and mysqlclient_mixed.olb?
_________________
Martin Borgman
OpenOffice.org On OpenVMS porting group.
www.oooovms.dyndns.org
Back to top
View user's profile Send private message Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Wed Apr 05, 2006 7:05 pm    Post subject: Reply with quote

Martin Borgman wrote:
By the way, what is the difference between mysqlclient_upper.olb and mysqlclient_mixed.olb?

mysqlclient_mixed.olb contains objects compiled using /name=as_is
mysqlclient_upper.olb contains objects compiled using /name=upper

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin Borgman



Joined: 02 Apr 2006
Posts: 5
Location: Netherlands

PostPosted: Wed Apr 05, 2006 9:03 pm    Post subject: Reply with quote

jfp wrote:
mysqlclient_mixed.olb contains objects compiled using /name=as_is
mysqlclient_upper.olb contains objects compiled using /name=upper

JF


OK, this means no need to use the mixed version.

As for the build on 8.2:

The Apache source kits CSWS-V21-ALPHA-SRC.BCK_SFX_AXPEXE and CSWS-V21-IA64-SRC.BCK_SFX_I64EXE contain one big saveset. In this saveset you'll find the component savesets. You need the APL-SOURCE.BCK and the PHP-SOURCE.BCK to build PHP extensions.
You need installed versions of Apache v2.1 and PHP v1.3 on your system. In this particular case you also need installed versions of ZLIB 1.2.2, SSL v1.2 and MySQL 4.1.14. Newer versions of SSL and ZLIB also work.
Unpack the source kits.
Create a DCL procedure named build.com: in the yourdev:[<yourunpackdir>.BUILD.php.ALPHA-CSWS_PHP-V0103.ext.mysql]
Code:
$ DEFINE ext DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.ext]
$ DEFINE regex DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.regex]
$ DEFINE main DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.main]
$ DEFINE TSRM DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.TSRM]
$ DEFINE PHPINC DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.main]
$ DEFINE PHPINC2 DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103]
$ DEFINE PHPTSRM DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.TSRM]
$ DEFINE PHPZEND DSA100:[BUILD.php.ALPHA-CSWS_PHP-V0103.zend]
$ DEFINE PortLIB DSA100:[BUILD.apl.ALPHA-V1_0.PortLIB]
$ CC php_mysql /FLOAT=IEEE -
     /INCL=(PHPINC2, PHPINC, PHPZEND, PHPTSRM, PortLIB,mysql_root:[include]) /NAME=SHORT/LIS/SHOW=ALL
$ DEFINE mysqlclient MYSQL_ROOT:[VMS.lib]mysqlclient_upper.OLB
$ LINK/SHARE php_mysql.OBJ, MYSQL-V0104-.OPT /opt

This is obviously for the Alpha sources and they were unpacked on the root of DSA100. You may need to edit this file for your particular situation.

Next create the MYSQL-V0104-.OPT file in the same directory:
Code:
!
! Image Ident
!
IDENTIFICATION="MYSQL V1.3"             ! VMS port version
BUILD_IDENT="PHP V4.3.10"               ! PHP release build
!
! Shareables
!
APACHE$ROOT:[PHP.BIN]PHPSHR/Share                            ! PHP Shareable
mysqlclient/lib
SYS$LIBRARY:SSL$LIBSSL_SHR32/share
SYS$LIBRARY:SSL$LIBCRYPTO_SHR32/share
LIBZ_SHR32/share
!
! symbol vector detailing the globals exported by the shareable image.
!
symbol_vector=(get_module=PROCEDURE)

You should get a php_mysql.EXE now, but unfortunately there are a few strange problems in the source code.

The first one in in [-.-.main]php.h. look for "#include <sys/param.h>" and for now just comment it out:
Code:
#if HAVE_PWD_H
# ifdef PHP_WIN32
#include "win32/pwd.h"
#include "win32/param.h"
#elif defined(NETWARE)
#ifdef NEW_LIBC
#include <sys/param.h>
#else
#include "NetWare/param.h"
#endif
#include "NetWare/pwd.h"
# else
#include <pwd.h>
/* #include <sys/param.h> */
# endif
#endif

The nest file is [-.-.TSRM]tsrm_config_common.h with the same problem:
Code:
#ifdef TSRM_WIN32
# include "tsrm_config.w32.h"
#elif defined(NETWARE)
# include "tsrm_config.nw.h"
#else
# include "tsrm_config.h"
/* # include <sys/param.h> */
#endif

The strange thing is that OpenVMS never had a <sys/param.h>, so what is it still doing in these source files?

Now you can build php_mysql.EXE.
_________________
Martin Borgman
OpenOffice.org On OpenVMS porting group.
www.oooovms.dyndns.org
Back to top
View user's profile Send private message Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Wed Apr 05, 2006 10:12 pm    Post subject: Reply with quote

Many thanks for those detailed description.

However I expect some problems if you try to use a SSL connection because HP SSL is not compiled using IEEE floats, and MySQL required this, initial port don't do that and some request return wrong results, so it is mandatory.

Thanks again for your help.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin Borgman



Joined: 02 Apr 2006
Posts: 5
Location: Netherlands

PostPosted: Wed Apr 05, 2006 10:45 pm    Post subject: Reply with quote

OK,

Is your SSL version compiled with IEEE floats?

I know the answer, it's yes.

OK this means we need to install your SSL kit and change the option file to:
Code:
!
! Image Ident
!
IDENTIFICATION="MYSQL V1.3"             ! VMS port version
BUILD_IDENT="PHP V4.3.10"               ! PHP release build
!
! Shareables
!
APACHE$ROOT:[PHP.BIN]PHPSHR/Share                            ! PHP Shareable
mysqlclient/lib
OPENSSL097E_LIBSSL_SHR32/share
OPENSSL097E_LIBCRYPTO_SHR32/share
LIBZ_SHR32/share
!
! symbol vector detailing the globals exported by the shareable image.
!
symbol_vector=(get_module=PROCEDURE)

_________________
Martin Borgman
OpenOffice.org On OpenVMS porting group.
www.oooovms.dyndns.org
Back to top
View user's profile Send private message Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Fri Apr 07, 2006 11:14 am    Post subject: Reply with quote

Martin Borgman wrote:
Is your SSL version compiled with IEEE floats?

I know the answer, it's yes.

Correct Smile

You may use a more up to date version of SSL like 0.0.7i or 0 .9.8a
and if you don't want to install the kit just extract the 2 necessaries objects libraries.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WillemGrooters



Joined: 15 Apr 2006
Posts: 36

PostPosted: Tue Apr 18, 2006 11:55 am    Post subject: Some problem left Reply with quote

I did build it the way Martinn described (using CC 7.1 on VMS 8.1 (AXP)) but here Apache (or MOD_PHP) seems to have some troubvle recognizing it as a PHP library Sad .
In analyzing the image, I found that the original version stores teh module name as "PHP_MYSQL" and the newly built as "php_mysql".
If this case difference causes a problem how to get around it?
(This has been mentioned in the HP ITRC OpenVMS Forum as well)
Back to top
View user's profile Send private message Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Tue Apr 18, 2006 1:01 pm    Post subject: Re: Some problem left Reply with quote

Willem,

you can try using SDA to do
sh proc/image/index=xxxxx
where xxx is te pid of a process which run PHP PHP and try to load the "PHP_MYSQL" module to check if it is loaded or not.

on my system PHP extensions are installed on an ODS2 disk and on my IA64 box which use an ODS5 disk PHP_MYSQL use a upper case name without any problem, so you may try.

Also be sure that others libraries are loaded.
you can try to run PHP_MYSQL.EXE if you got an error like
%RMS-W-NOMSG, Message number 000177C0
-NONAME-W-NOMSG, Message number 00000000

(message number may vary) you shareable is probably correct, but if you got an error about activation any shareable you will have to fix this.


Jean-François
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WillemGrooters



Joined: 15 Apr 2006
Posts: 36

PostPosted: Sun Apr 23, 2006 10:19 pm    Post subject: Reply with quote

SDA shows PHP will not load PHP_MYSQL, which is obvious, I think, since PHP cannot determine PHP_MYSQL.EXE as an PHP library.
When running PHP interactively, the first thing that is displayed, it this message:
Code:
$ php php_openvms.php
PHP Warning:  Unknown(): Invalid library (maybe not a PHP library) 'php_mysql.ex
e'  in Unknown on line 0

and running PHP_MYSQL.EXE shows the error you showed.

I think, however, that I found the problem.

I built the exetable using logicals for both SSL libraries, referring to the shared images in the mysql or PHP directory tree:

Code:
$ CC PHP_MYSQL /FLOAT=IEEE -
     /INCL=(PHPINC2, PHPINC, PHPZEND, PHPTSRM, PortLIB,mysql_root:[include]) -
     /NAME=SHORT/LIS/SHOW=ALL
$ DEFINE mysqlclient MYSQL_ROOT:[VMS.lib]mysqlclient_upper.OLB
$ DEFINE OPENSSL098A_LIBSSL_SHR32 MYSQL_ROOT:[VMS.lib]OPENSSL098A_LIBSSL_SHR32.exe
$ DEFINE OPENSSL098A_LIBCRYPTO_SHR32 MYSQL_ROOT:[VMS.lib]OPENSSL098A_LIBCRYPTO_SHR32.exe
$ LINK/SHARE PHP_MYSQL.OBJ, MYSQL-V0104-.OPT /opt


and PHP_SETUP.COM had the same reference as BUILD.COM.
I also tried APACHE$COMMON:[PHP.EXTENSIONS] as a location as well, but that didn't work eitherr; For some reason, PHP does not take these locations into account, and requires the files to reside these files on SYS$LIBRARY. Sad

It's after I copies these files, that the error was gone.

It is possible to take other than the default location in account? [/code]
Back to top
View user's profile Send private message Visit poster's website
WillemGrooters



Joined: 15 Apr 2006
Posts: 36

PostPosted: Sun Apr 23, 2006 11:08 pm    Post subject: too early... Reply with quote

Sad still not working Sad

Running PHP interactively theer is no problem at all. But trying anything from Apache (2.1) that will access MYSQL has the same problem, and other scripts (php_calendar, php_info) have no problem at all.

So it's just Web-based access that failes - no matter what - with the same problem as before.
the OpenSSL exe's have W:RE as protection so that could not be the problem.
Of course I could give apache$www give SYSPRV but for securtity reasons, that is NOT an aoption.

Another thing I noticedL I built PHP_MYSQL.EXE using openssl098A - and PHP-INO shows 097D. But that should not be the problem since interactive usage has no problem at all.
Back to top
View user's profile Send private message Visit poster's website
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Mon Apr 24, 2006 7:51 am    Post subject: Reply with quote

Willem,

You may try to link using the .olb libraries instead of the shareables, this is how I, now, build Python and MySQL.


JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WillemGrooters



Joined: 15 Apr 2006
Posts: 36

PostPosted: Mon Apr 24, 2006 8:34 pm    Post subject: Now working Reply with quote

I took your suggestion and used the OLB with the same name als LIBZ_SHR32: libz32_EV56.olb/lib

I got this:
Code:

%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM,         COMPRESS
%LINK-I-UDFSYM,         UNCOMPRESS
%LINK-W-USEUNDEF, undefined symbol COMPRESS referenced
        in psect $LINK$ offset %X00000050
        in module MY_COMPRESS file MYSQL_ROOT:[VMS.LIB]mysqlclient_upper.olb;1
%LINK-W-USEUNDEF, undefined symbol UNCOMPRESS referenced
        in psect $LINK$ offset %X000000B0
        in module MY_COMPRESS file MYSQL_ROOT:[VMS.LIB]mysqlclient_upper.olb;1

so that is to be no alternative either. Sad

Idea
Since it seemed the problem was in the shared images - to be more precise: the location they reside in - I decided to have all reside in SYS$LIBRARY, and refer to them using the names as specified by PHP on error, place them BUILD.COM before the LINK statement:
Code:

$ DEFINE ext DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.ext]
$ DEFINE regex DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.regex]
$ DEFINE main DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.main]
$ DEFINE TSRM DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.TSRM]
$ DEFINE PHPINC DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.main]
$ DEFINE PHPINC2 DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103]
$ DEFINE PHPTSRM DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.TSRM]
$ DEFINE PHPZEND DEV:[BUILD.php.ALPHA-CSWS_PHP-V0103.zend]
$ DEFINE PortLIB DEV:[BUILD.apl.ALPHA-V1_0.PortLIB]
$ CC PHP_MYSQL /FLOAT=IEEE -
     /INCL=(PHPINC2, PHPINC, PHPZEND, PHPTSRM, PortLIB,mysql_root:[include]) -
     /NAME=SHORT/LIS/SHOW=ALL
$ DEFINE mysqlclient MYSQL_ROOT:[VMS.lib]mysqlclient_upper.OLB
$!
$! PHP_MySQL build: shared images in SYS$LIBRARY
$!
$ DEFINE LIBZ_SHR32 sys$library:libzshr32-1_2_3_ev56.exe
$ DEFINE LIBSSL sys$library:OPENSSL098A_LIBSSL_SHR32.exe
$ DEFINE LIBCRYPTO sys$library:OPENSSL098A_LIBCRYPTO_SHR32.EXE
$!
$ LINK/SHARE PHP_MYSQL.OBJ, MYSQL-V0104-.OPT /opt


Used these references in the option file:
Code:
!
! Image Ident
!
IDENTIFICATION="MYSQL V1.3"             ! VMS port version
BUILD_IDENT="PHP V4.3.10"               ! PHP release build
NAME="PHP_MYSQL"
!
! Shareables
!
APACHE$ROOT:[PHP.BIN]PHPSHR/Share                            ! PHP Shareable
mysqlclient/lib
!
! PHP_MySQL build: shared images in SYS$LIBRARY
!
LIBSSL/share                       ! SSL
LIBCRYPTO/share                 ! SSL
!
LIBZ_SHR32/share
!
! symbol vector detailing the globals exported by the shareable image.
!
symbol_vector=(get_module=PROCEDURE)


and added the same references in APACHE$COMMON:[000000]PHP_SETUP.COM - just to be sure:
Code:
...
$ DEFINE /NoLog DECC$EFS_CASE_PRESERVE ENABLED
$ DEFINE /NoLog DECC$EFS_CASE_SPECIAL ENABLED
$ DEFINE /NoLog DECC$EFS_CHARSET ENABLED
$ DEFINE /NoLog DECC$FILE_SHARING ENABLED
$ PHP_ROOT = F$TRNLNM ("APACHE$COMMON") - "]" + "PHP.]"
$ DEFINE /NOLOG /TRANS=CONCEAL PHP_ROOT 'PHP_ROOT'
$ DEFINE /NOLOG PHPSHR PHP_ROOT:[BIN]PHPSHR.EXE
$!
$! due to build of PHP_MYSQL for 4.1 in SYS$LIBRARY or these
$! won't be found
$!
$ DEFINE/JOB/NOLOG LIBZ_SHR32 sys$library:libzshr32-1_2_3_ev56.exe
$ DEFINE/JOB /NOLOG LIBSSL sys$library:OPENSSL098A_LIBSSL_SHR32.exe
$ DEFINE/JOB /NOLOG LIBCRYPTO sys$library:OPENSSL098A_LIBCRYPTO_SHR32.EXE
$!
$ PHP :== $ PHP_ROOT:[BIN]PHP.EXE
$ GOTO EXIT
...


Built the executable, copied it to APACHE$COMMON:[PHP.EXTENSIONS] and cycled Apache. Tried databse access

BEHOLD: IT WORKS. Very Happy

It would be nicer, if shared images could be located anywhere, as long as the logicals are just right. But for the time, this is sufficient.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> MySQL for OpenVMS All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group