[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 886
  • Last Modified:

Introducing Oracle to PHP/Apache

I have a UNIX website running Apache 1.3.33 and PHP 4.4.0 and I have compiled it with the following options:

./configure --with-mysql=/mysql-4.0.26 --with-apxs=/apache_1.3.3
3/bin/apxs --with-ldap=/openldap-2.2.26

Now I am introducing Oracle to the scene. we have Oracle 9 server and I would like  to know what is involved in using Oracle SQL with PHP and Apache. I'd like to know if it there is an easy way, or if I need to recompile.

My oracle client has been installed at:
/oracle/product/10.2.0 by our DBA, I have no idea what to do with that.


Thanks
0
kalmen
Asked:
kalmen
  • 7
  • 4
  • 2
6 Solutions
 
hernst42Commented:
Download php4.4.0 untar and try:

cd php-4.4.*/ext/oci8
phpize
./configure
make
make install

If all lib and environment variables are set correctly the oci extension is build, without rebuilding the whole php. Then edit your php.ini and add:
extension=oci8.so
Restart webserver and you should have oracle connectivity.
0
 
kalmenAuthor Commented:
Hi All,

I'll give everything a try, and get back to you. Thank you for your feedback.

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
kalmenAuthor Commented:
Hi There,

I finally got it to compile. I was getting this error:
In file included from /php-4.4.0/ext/oci8/oci8.c:50:
/php-4.4.0/ext/oci8/php_oci8_int.h:56:17: oci.h: No such file or directory

So I downloaded the sdk from oracle that had the oci.h and added it to the makefile:
EXTRA_INCLUDES = -I /instantclient_10_2/sdk/include

Then I got a folder called modules that has two oci8 files. I moved them to /usr/local/lib and added them to the php.ini:
extension=oci8.so

But when I restart nothing works... Any idea on troubleshooting?
0
 
psimationCommented:
Did you use the installers available here: http://www.oracle.com/technology/software/tech/oci/instantclient/index.html as per my original post?
0
 
kalmenAuthor Commented:
Actually, our DBA installed it for me, it is at:
/oracle/product/10.2.0
# ls
DISK              css               instantclient32   jpub              odbc              perl              root.sh.old       tg4ifmx
OPatch            diagnostics       inventory         jre               olap              plsql             slax              tg4ingr
assistants        has               jar               ldap              oraInst.loc       precomp           sqlj              tg4sybs
bin               hs                javavm            lib               oracore           racg              sqlnet.log        tg4tera
cfgtoollogs       install           jdbc              lib32             ord               rdbms             sqlplus           uix
classes           install.platform  jdk               network           oui               relnotes          srvm              wwg
crs               instantclient     jlib              nls               owm               root.sh           sysman            xdk
0
 
hernst42Commented:
in this case the option should be --with-oci8=/oracle/product/10.2.0

and in that directory you should find rdbms/public/oci.h Then the dba did a good job ;-)
0
 
kalmenAuthor Commented:
The compilation worked even better this time. But, I still can't get apache to work... Am I putting the so files in the right place? Am I missing a variable or something?
0
 
kalmenAuthor Commented:
Here is an error message:

[Thu Nov  8 09:17:42 2007] [notice] mod_security/1.9.4 configured - Apache/1.3.33 (Unix)
PHP Warning:  PHP Startup: Unable to load dynamic library './oci8.so' - ld.so.1: httpd: fatal: ./oci8.so: open failed: No such file or directory in Unknown on line 0
0
 
hernst42Commented:
check your php.ini for extension_dir and make sure it's the same value where the oci8.so was installed.
0
 
kalmenAuthor Commented:
Well, I put the file in the /usr/local/lib/ and php.ini exists in the same place. This is the line in the ini file.
extension_dir = "./"

0
 
hernst42Commented:
in this caste the line must be:
extension_dir = "/usr/local/lib/"

(and don't forget to restart the webserver after the change)
0
 
kalmenAuthor Commented:
Got it working (haven't tested in webpages) but at least I got it running.

Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 7
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now