我将PHP + Oracle移动到运行Linux的新服务器(之前的Server运行Sun)。
现在我收到以下错误:
Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories in /opt/m/app/zerfa/test3.php on line 7
Warning: oci_connect(): ORA-01804: failure to initialize timezone information in /opt/m/app/zerfa/test3.php on line 7
Connection Failed: /u00/app/oracle/product/11.2.0/dbhome_2/lib --- /u00/app/oracle/product/11.2.0/dbhome_2
创建它的代码是:
<?
$test = getenv('LD_LIBRARY_PATH')." --- ".getenv('ORACLE_HOME');
$this2 = oci_connect("m1","m1", "DMX16") or die("<b>Connection Failed: $test </b>").oci_error();
$conn = OCILogon( "m1", "m1", "DMX16") or die;
$stmt = ocipars($conn, "SELECT * FROM ibresa") or die;
ociexecute($stmt);
echo "<HTML><PRE>";
while (ocifetch($stmt)) {
print "\n";
$ncols = ocinumcols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
$column_name = ocicolumnname($stmt,$i);
$column_value = ociresult($stmt,$i);
print $column_name . ': ' . $column_value . "\n";
}
print "\n";
}
ocifreestatement($stmt);
ocilogoff($conn);
echo "</PRE></HTML>\n";
ocilogoff($handle);
?>