- 论坛徽章:
- 0
|
apache已经支持php了,通过phpinfo()能够 在网页中显示php的信息。但是在php中写入调用数据库的代码时,网页上却不能显示连接成功。
代码应该没有问题,因为在terminal中能运行成功,并成功连接到oracle。
希望各位大侠能给与解答。
[root@ssli-linux html]#
[root@ssli-linux html]# pwd
/var/www/html
[root@ssli-linux html]# cat ora.php
<?php
//$_ENV["ORACLE_HOME"]="/data01/oracle";
//print "getenv is: ".getenv("ORACLE_HOME" ."\n";
//print "env is: ".$_ENV["ORACLE_HOME"]."\n";
//$ORACLE_HOME = "/data01/oracle";
if ($conn=ocilogon("hr","hr",ssli))
{ echo "SUCCESS ! Connected to database\n";
}else
{echo "Failed Could not connect to database\n";}
ocilogoff($conn);
?>
[root@ssli-linux html]#
[root@ssli-linux html]# php ora.php
PHP Notice: Use of undefined constant ssli - assumed 'ssli' in /var/www/html/ora.php on line 6
Content-type: text/html
X-Powered-By: PHP/4.3.9
SUCCESS ! Connected to database
[root@ssli-linux html]#
|
|