On Fri, 06 Feb 2004 20:27:14 +0100, "PI*****@HOME.NL" <PI*****@HOME.NL> wrote:
I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
first time I did give them the list right as well. So maybe this
little extra info can help.
And only 1 home :)
It's often best to trim everything down to basics when it starts Doing Weird
Things. The corrupted-looking message probably qualifies as weird.
A checklist off the top of my head, if you post replies to each point at least
it'll show where you stand:
(1) Environment:
What's in PATH?
echo $_ENV['PATH'];
Where's your Oracle home?
echo $_ENV['ORACLE_HOME'];
Although this may well not be set, since you're not actually supposed to set
ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
information in the registry instead).
Others:
echo $_ENV['TNS_ADMIN'];
echo $_ENV['NLS_LANG'];
(2) Does sqlplus work from the command line?
sqlplus username/password@database
< do some stuff like select sysdate from dual >
(3) Does sqlplus work from PHP?
<pre>
<?php
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$process = proc_open("sqlplus test/test@dev92lnx", $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);
while(!feof($pipes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
$return_value = proc_close($process);
echo "command returned $return_value\n";
}
?>
</pre>
(4) What does a minimal OCI8 example do? (alter username/password/database as
necessary):
<pre>
<?php
putenv("NLS_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");
if (!$conn = OCILogon("test","test","dev92lnx")) {
$err = OCIError();
die($err['message']);
}
print "<hr>Server Version: " . OCIServerVersion($conn) . "<hr>";
if (!$stmt = OCIParse($conn,"
select sysdate from dual
")) {
$err = OCIError();
die($err['message']);
}
if (!OCIExecute($stmt)) {
$err = OCIError();
die($err['message']);
}
while (OCIFetchInto($stmt, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {
print_r($row);
}
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
</pre>
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>