This discussion is archived
7 Replies Latest reply: Nov 13, 2011 9:34 AM by 888101 RSS

Server Error:configure 9i with php

888101 Newbie
Currently Being Moderated
Respected
I want to configure oracle 9i version 9.2.0.1.0 with php on windows xp. First of all I tried with apache 2 but it was clashing with oracle's apache therefore I installed appserv 2.6.0 and given the port 81 for the "localhost:81". In this way I succeeded to run the php simple program "hello world" using "localhost:81/test/hello.php" but when I executed the connected program(check below) it gives *"The website encountered an error while retrieving http://localhost:81/test/test1.php. It may be down for maintenance or configured incorrectly".* HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
I have done following changes in php.ini and http.conf
1- kept php.ini in c:\windows
2- set the doc_root
3- extension_dir
4- session.save_path="c:\temp"
5- uncomment the line extension=php_oci8.dll
http.conf
1- Allowoverride None to All
2- DirectoryIndex element has been set with index.php
3- AddType command for php "AddType application/x-http-php .php" is set
4- LoadModule php6_module has been set with "LoadModule php6_module C:/AppServ\php\php6apache2_2.dll" Remeber appserv is using php6 and I could not find "php_oracle.dll" in ext folder of php6

connected Program
<?php
$conn=oci_connect('scott@orcl','tiger','//localhost:81/orcl');
if(!$conn){
$m=oci_error();
echo $m['message'],"\n";
exit;
}
else
{
print "connected to oracle";
}
oci_close($conn);
?>

*2nd program*
<?php
<?
if ($conn=Ora_Logon("scott@orcl","tiger")){
echo "<B>SUCCESS ! Connected to database <B>\n";
}
else
{
echo "<B>Failed<B>\n";
}
Ora_Logoff($conn);
phpinfo();
?>
please help me where I am wrong, I want to run php on the same machine where database resides.

Edited by: 885098 on Nov 2, 2011 12:03 PM
  • 1. Re: Server Error:configure 9i with php
    cj Employee ACE
    Currently Being Moderated
    The old php_oracle.dll (the extension named 'oracle') was long obsoleted by the newer php_oci8.dll (the extension named 'OCI8'). I would not expect your program using ora_logon() to work anymore. A function mapping between the old & new extensions is in Appendix D of the free book The Underground PHP and Oracle Manual.

    The Windows DLLs available from the PHP community build OCI8 using Oracle Instant Client 10g (or 11g for the php_oci8_11g.dll). You will need to have one of these new versions on your machine and make sure that PHP and the Database uses their appropriate version of the Oracle libraries without causing name clashes. This is easier said than done on Windows.

    Finally, there is no PHP version 6 available or even planned. The PHP community is currently focusing on PHP 5.4, which is Beta.

    You may find it easier to install Oracle XE 11.2 (http://www.oracle.com/technetwork/database/express-edition/downloads/index.html) and use PHP with those libraries. Or install and use Linux.
  • 2. Re: Server Error:configure 9i with php
    888101 Newbie
    Currently Being Moderated
    Thank u very much, please tell me should I use Apache separately with 11g R2 Express Edition or my approach using "AppServ" is correct ? 2ndly I read an article that there is no need any client software if u r using same machine for oracle database software and php
  • 3. Re: Server Error:configure 9i with php
    cj Employee ACE
    Currently Being Moderated
    1. I've not looked at AppsServ. If it's the same as I googled, then it looks like an old version of PHP.
    You might consider looking at Zend Server instead.

    2. Yes you don't need Oracle client software if PHP & the Oracle DB are on the same machine. But if
    your PHP OCI8 DLLs were built requiring a certain minimum version of Oracle libraries and your DB
    is not equal or greater than that version, then you'll need to (a) get that minimum version of the Oracle
    libraries or (b) recompile PHP yourself.
  • 4. Re: Server Error:configure 9i with php
    888101 Newbie
    Currently Being Moderated
    Thank u I just start according to your instructions. According to the discussion I am going to start 11g R2 express edition and with zend server or Apache, I hope so need of client software ll be omit. my direction is correct?

    Edited by: 885098 on Nov 4, 2011 11:14 AM
  • 5. Re: Server Error:configure 9i with php
    cj Employee ACE
    Currently Being Moderated
    It seems a fair starting point.
  • 6. Re: Server Error:configure 9i with php
    cj Employee ACE
    Currently Being Moderated
    If Windows becomes too painful to do development work on, this article shows how to run PHP on Linux as a virtual machine inside Windows: http://css.dzone.com/articles/using-virtusal-machine-play
  • 7. Re: Server Error:configure 9i with php
    888101 Newbie
    Currently Being Moderated
    Thank u very much Mr cj, done what I wanted and now I am enjoying with oracle database. I used apache httpd-2.2.21-win32-x86-no_ssl , php-5.2.17-Win32-VC6-x86 with oracle 11R2 express edition. your article is also helpful on http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html to understand further.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points