Hey all,

hoping for a bit of help if possible! 😃 I'm unsure if this is the right place for this question. But here goes anyway!

I installed PHP 5.2.4, Apache 2.2 and Oracle XE 10g today. I've set it up, and PHP is working fine on my server. However i'm having a bit of trouble with Oracle. I've pointed php.ini to the correct ext directory, and i've 'uncommented' the line "extension = php_oci8.dll".

However when I go to connect to the database, I get the error "Call to undefined function: ora_logon()/ ocilogon()" I checked phpinfo, and the module has not been activated which explains the error.

So I did a bit of research, and I read that I need uncomment the line ";extension = php_oracle.dll" in php.ini. However this line does not exist. I then read that to get this line, I need to compile PHP with "--with-oracle=/path/to/oracle/home/dir".

I'm at a bit of a loss how to do this?

Any help would be much appreciated. I'm using Windows.

    Update:

    I found php_oracle.dll in the PHP5 binary .zip and put it in the 'ext' directory. I then added the line 'extension=php_oracle.dll' to php.ini... And still no luck 🙁 The module is still not showing in phpinfo.

      If you're using Windows, then you don't need to worry about compiling anything - that's for the Unix folks.

      What you need to do is make sure you have all of the files. There should be a large number of .dll files within the main PHP directory (mine's c:\php\ - substitute in your own path as needed).

      Also make sure that the extension direcotry is properly set in your php.ini file.

      Finally, make sure you've added the main PHP directory to your system's PATH environment variable (the FAQ in this forum has links that explain how to do this).

        I've tried all of the things you mentioned, including the environment variable. But still no luck. Any other ideas?

          Have you installed the Oracle client libraries? For more information, see the manual page for [man]OCI8[/man] under the "Requirements" heading.

            I've done all that.

            I just realised the problem may not be with Oracle. No matter what extensions I enable, PHP will not detect them.

            Any ideas?

              You mean you can remove the ; from the extension= line and a new table doesn't show up in a phpinfo() output? Sounds like PHP isn't reading your php.in file.

              What does your PHPIniDir directive in your httpd.conf file look like?

                bradgrafelman wrote:

                You mean you can remove the ; from the extension= line and a new table doesn't show up in a phpinfo() output? Sounds like PHP isn't reading your php.in file.

                What does your PHPIniDir directive in your httpd.conf file look like?

                Yup I think that's the problem.. solving it is a mission though..

                PHPIniDir "C:/Web/WebServer/PHP/"

                I also tried PHPIniDir "C:/Web/WebServer/PHP" (no trailing slash)

                  Are you positive the file "php.ini" is in that directory? Make sure you're not hiding file extensions (Tools -> Folder Options, uncheck "Hide file extensions for known file types") and that it's not actually called php.ini.txt ?

                  Note if you've made any changes that a restart of Apache will be required.

                  Also, try changing one of the other settings, such as display_startup_errors to On, and see if phpinfo() reflects this change.

                  Finally, how is PHP integrated with Apache? As an ISAPI module (e.g. there's a LoadModule line that loads the .dll file in httpd.conf) or a CGI binary (httpd.conf points to the CLI - the .exe file)?

                    Woohooo! I got it!!!!!! 😃

                    Wow, over 24 hours of troubleshooting and it comes down to something as simple as this.

                    When I unchecked "Hide file extensions for known file types" I noticed that php.ini had "recommend" after it! So obviously PHP wasn't recognising the file!

                    Cheers for your help! I really really appreciate it. 😃

                      No problem. Don't forget to mark this thread resolved.

                      (Sorry it took over 24 hours... I've been quite busy :p)

                        Write a Reply...