473,378 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

ociExecute() dies silent on CGI mode php.

Hello.
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
<?php
$conn = ociLogon('scott', 'tiger', 'testdb');
$stmt = ociParse($conn, "SELECT COUNT(*), MAX(entry_date) FROM
ct_abbr");
ociExecute($stmt);
if (ociFetch($stmt)) {
echo "COUNT(*) : ", ociResult($stmt, 1), "\n";
echo "MAX(entry_date) : ", ociResult($stmt, 2), "\n";
ociFreeStatement($stmt);
}
ociLogoff($conn);
?>

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()

<?php
ini_set("display_errors", 1);

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

putenv("ORACLE_BASE=$ORACLE_BASE");
putenv("ORACLE_HOME=$ORACLE_HOME");
putenv("PATH=$PATH");
putenv("LD_LIBRARY_PATH=$LD_LIBRARY_PATH");
putenv("TNS_ADMIN=$TNS_ADMIN");
putenv("NLS_LANG=$NLS_LANG");

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

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

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

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

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 2209
On Mon, 13 Feb 2006 19:26:53 -0800, LeaFriend wrote:
$conn = ociLogon('scott', 'tiger', 'testdb'); //exit($stmt); $stmt =
ociParse($conn, $que); //exit($stmt);
ociExecute($stmt);exit($stmt);

^^^^^^^^^^^
Very odd. This should be commented out, no?

--
Ben.

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: TThai | last post by:
Hi, I've created an application that uses crystal report in VB dotnet environment. I've created an MSI package to be installed on the client pc to make the crystal report to work. However, the...
3
by: Li Pang | last post by:
Hi, I'd like to run a cmd.exe in a silent mode (without the windows interface). Any body knows? Thansk in advance
1
by: eelisdotnet | last post by:
Hi I have an application that have to be installed in silent/passive mode. The first installation goes well. When I try to execute a silent/passive installation of the new version (new msi...
0
by: blkwebman | last post by:
I'm trying to create a "standalone" install package (without any of the dialog boxes that a standard setup package would have). I think I understand how to do it in VB6 (using PDCmdLn.exe); I have...
1
by: goose28 | last post by:
Instructions for creating a silent install project in Visual Studio.NET 2003 for "All Users". 1) Create a default setup project for your application using Visual Studio (File/New/Setup and...
2
by: Sitamma | last post by:
Hi All I am using ActivePerl 64 bit, and running on DOS/Windows I am trying apply oracle patch by the below command perl -silent E:\oracle\product\10.2.0\client_1\OPatch\opatch.pl apply ...
4
by: alextki | last post by:
I have a C# console application, it gives the output as xyz.exe.. when i click this it will run with the command window.. how do i hide this command window when i click that exe.
0
by: WebCM | last post by:
PDO offers 3 modes of displaying errors: - silent mode - no errors - warnings - Warning: - exceptions - Exception: Which of them is the fastest and the most adequate for applications like CMS...
0
by: MNMikew | last post by:
I'm attempting to do a silent install of NetSearch Extender (NSE) on a Windows 64bit machine and it is not creating the Windows service. If I run the GUI install in record mode (setup.exe -r) it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.