469,648 Members | 1,557 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

ociExecute() dies silent on CGI mode php.

It's rainy day of winter in here. :(

I install php on AIX, with OCI8 ext.
WebServer is WebtoB, WAS is JEUS.
There was a problem on compiling (oci.h is not found) and linking.
(machine was 32bit system, but default oracle library path
/tmax/oracle/client/lib is for 64bit)
Anyway, i fixed Makefile and php work well with OCI on CLI.
This is my script.

#!/usr/local/bin/php -f
$conn = ociLogon('scott', 'tiger', 'testdb');
$stmt = ociParse($conn, "SELECT COUNT(*), MAX(entry_date) FROM
if (ociFetch($stmt)) {
echo "COUNT(*) : ", ociResult($stmt, 1), "\n";
echo "MAX(entry_date) : ", ociResult($stmt, 2), "\n";

When I run ./oci.php, It shows good result.

COUNT(*) : 9364
MAX(entry_date) : 20060213

But I try to access it via web, it doesn't work.
First i found environmental variables aren't set.
so modified source to add puenv()

ini_set("display_errors", 1);

$ORACLE_BASE = "/tmax/oracle";
$PATH = getenv("PATH") . ":$ORACLE_HOME/bin";
$TNS_ADMIN = "$ORACLE_HOME/network/admin";
$NLS_LANG = "American_america.KO16KSC5601";


$que = "SELECT COUNT(*), MAX(entry_date) FROM ct_abbr";

$conn = ociLogon('scott', 'tiger', 'testdb'); //exit($stmt);
$stmt = ociParse($conn, $que); //exit($stmt);
if (ociFetch($stmt)) {
echo "COUNT(*) : ", ociResult($stmt, 1), "\n";
echo "MAX(entry_date) : ", ociResult($stmt, 2), "\n";

This script work until ociParse().
But if ociExecute() is called, browser show white page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type
content="text/html; charset=ks_c_5601-1987"></HEAD>

I don't know why it work on cli, but not on cgi.
(phpinfo() show Server API is cgi)
Please help me...

Feb 14 '06 #1
2 2106
On Mon, 13 Feb 2006 19:26:53 -0800, LeaFriend wrote:
$conn = ociLogon('scott', 'tiger', 'testdb'); //exit($stmt); $stmt =
ociParse($conn, $que); //exit($stmt);

Very odd. This should be commented out, no?


Feb 14 '06 #2
That's not commented,
If exit($stmt) is run, then 'Resource #...' should be printed,
but browser show 'page not found'.
It doesn't show blank white page anymore... :(

Feb 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by TThai | last post: by
3 posts views Thread by Li Pang | last post: by
1 post views Thread by eelisdotnet | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.