Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Can't start Apache with Oracle10g on OpenVMS

 
SOLVED
Go to solution
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

Willem
>Does PHP itself work?
Yes, PHP works well.
>Try this with PHP_ORI8 enabled in PHP.INI. If it works, see if you can get a PHP code that accesses your oracle database and do the same. If this works, the problem is really within the PHP Oracle extension.
I'll try this tomorrow(It's 9 P.M. here now.).
Thanks Willem!

Duncan
Yes, we have the logical APACHE$OCI_SHR defined, but the logical APACHE$OCI_PFX is not defined.
I'll try if I can get any new version of the module to see whether this would solve the problem.
Thanks.
Duncan Morris
Honored Contributor

Re: Can't start Apache with Oracle10g on OpenVMS

I noticed this line in your log

%DCL-I-SUPERSEDE, previous value of APACHE$OCI_SHR has been superseded

Is it possible that you are overwriting the desired value with a bad one?

Duncan
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

Willem!
I found the error! While trying "$PHP php_odbc.php" and some other scripts, I found PHP couldn't find it's extension directory because the logical PHP_ROOT was not defined!(I don't know why this logical name is not define this time. We don't have to define this logical manually in our elder systems.)
I add a definition of PHP_ROOT in login.com:
$ DEFINE PHP_ROOT $11$DKB0:[SYS0.SYSCOMMON.APACHE.PHP.]
And this solved the problem!

Thank you all!
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

New problem!
Apache started successfully when php_oci8 enabled but PHP script can't logon to oracle database.

PHP script for test:
$ type test1.php
echo "Hello world !!!!!!!!!!!!!!!!!";
if ($conn=OCILogon("system", "bkmasic", "MASIC")) {
echo "Successfully connected to Oracle.\n";
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text];
}

ocilogoff($conn);
?>

login.com in apache root:
$ TYPE LOGIN.COM
$ ! Login.Com for Apache HTTP (WWW) Server
$ !
$! exit
$ !
$ ! Use the following DCL commands to prevent the APACHE$SPECIFIC:[000000]
$ ! directory from filling up with old LOG files by limiting the number of
$ ! versions of each file.
$ !
$ IF F$SEARCH ("$1$dga1:[oracle.lib32]LIBCLNTSH.SO") .NES. ""
$ THEN
$ DEFINE APACHE$OCI_SHR $1$dga1:[oracle.lib32]LIBCLNTSH.SO
$ DEFINE APACHE$OCI_PFX " "
$ ENDIF
$ DEFINE PHP_ROOT $11$DKB0:[SYS0.SYSCOMMON.APACHE.PHP.]
$ DEFINE ORACLE_HOME $1$DGA1:[ORACLE]
$ DEFINE ORACLE_SID masic
$! DEFINE ORACLE_BASE $1$DGA1:[ORACLE]
$! DEFINE PATH $1$DGA1:[ORACLE.BIN]
$ DEFINE TNS_ADMIN $1$DGA1:[ORACLE.NETWORK.ADMIN]tnsnames.ora
$ DEFINE NLS_LANG AMERICAN_AMERICA.ZHS16GBK
$ DEFINE ORA_NLS33 $1$DGA1:[ORACLE.NLS.DATA]
$ DEFINE LD_LIBRARY_PATH $1$DGA1:[ORACLE.LIB32]
$ temp1 = f$trnlnm("apache$specific")
$ temp2 = f$length(temp1)
$ temp3 = f$extract(temp2-1,1,temp1)
$ if (f$extract(temp2-2,1,temp1) .eqs. ".")
$ then temp1 = f$extract(0,temp2-2,temp1) + temp3
$ else temp1 = f$extract(0,temp2-1,temp1) + temp3
$ endif
$ set directory /version_limit=10 'temp1'
$ !
$ exit
$ ! End of file

Result of execution:
$ php test1.php
Content-type: text/html
X-Powered-By: PHP/4.3.10

Hello world !!!!!!!!!!!!!!!!!

Warning: ocilogon(): _oci_open_server: in /dkb0/vms$common/apache/sp
ecific/masic1/htdocs/test/test1.php
on line 3



Warning: ocierror(): OCIError: unable to find Error handle in /dkb0/v
ms$common/apache/specific/masic1/htdocs/test/test1.php
on line 6
>
Oracle Connect Error

I also tried to add putenv() in the PHP script to define those logicals but failed.
Willem Grooters
Honored Contributor

Re: Can't start Apache with Oracle10g on OpenVMS

I'm not that well in PHP (actually: practical zero) but either therse should be some "OCIError" in the PHP script, or it's missing in the Oracle extension. Try without callin OCIError and see what happens.
Willem Grooters
OpenVMS Developer & System Manager
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

Then the result would be:
$ php test.php
Content-type: text/html
X-Powered-By: PHP/4.3.10

Hello world !!!!!!!!!!!!!!!!!

Warning: ocilogon(): _oci_open_server: in /dkb0/vms$common/apache/sp
ecific/masic1/htdocs/test/test.php
on line 3

Oracle Connect Error

I met this kind of error before, and it was solved by setting the logical ORACLE_HOME correctlly before executing the script.
This time I set all the logicals correctlly ahead of time but still don't work.
Highlighted
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

My main objective is to make the function "ocilogon()" work.
Willem Grooters
Honored Contributor

Re: Can't start Apache with Oracle10g on OpenVMS

Take care of case. for PHP, case is significant.
Willem Grooters
OpenVMS Developer & System Manager
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

Yes, but I think this problem is not caused by any case error.
Actually we have a similar system which works well.
Here're the differences:
Good system Bad system
Alpha DS25 Integrity RX4640
APACHE2.1 for alpha same version for I64
PHP1.3 for alpha PHP1.3 for I64
ORACLE9I ORACLE10g

The same PHP script works well on the ALPHA system.
Z.K.
Frequent Advisor

Re: Can't start Apache with Oracle10g on OpenVMS

I want to start a new thread about this problem.
In which family/catagory do you think I should post this problem?