|
|
|
Here is what I had to do in order to get Oracle support compiled into php.
1. Download and install Oracle 8i for linux.
You have to install the whole thing, not just the client stuff.
2. Download the latest php3 (or php4) source code.
3. Figure out what configuration flags you want to set.
I used the following for php 4:
./configure --with-apxs=/usr/sbin/apxs \
--prefix=/usr \
--with-gd \
--enable-versioning \
--with-mysql=/usr \
--with-oracle=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5 \
--with-oci8=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5 \
--with-zlib \
--with-dbase \
--with-filepro \
--with-config-file-path=/etc/httpd/conf \
--with-fdftk=no \
--enable-debug=no \
--enable-magic-quotes \
--enable-debugger \
--enable-bcmath \
--enable-track-vars \
--enable-safe-mode \
--with-exec-dir=/usr/bin \
--with-system-regex \
--no-create \
--no-recursion
I took most of these compile options from a mod_php src rpm. The --with-oracle directive enables
php to talk to Oracle 7.x and 8.x servers with the ORA functions. The --with-oci8 enables php to use
the more robust oci8 interface.
4. make
5. make install
6. cp ./php.ini-dist /wherever/your/conf/files/are/php.ini
7. fix httpd.conf (I had to do this for Linux-Mandrake 6.1)
Change the line that says something like
LoadModule php4_module lib/apache/libphp4.so
to
LoadModule php4_module /usr/lib/apache/libphp4.so
8. Edit your php.ini file to re-enable sendmail support.(if you use mail() )
Add the path to sendmail to the "sendmail_path" line like:
sendmail_path = /usr/sbin/sendmail -t
You only have to do the above for php4, it can be left blank for php3
9. Restart apache
10. Test your php4 instalation.
Create a script with <? phpinfo(); ?> in it to find out what your php4 setup has built into it.
Make sure that it says something about Oracle and OCI8.
11. Try to use your new functionallity.
<?
// set some Oracle specific environment variables
putenv("ORACLE_SID=PROD");
putenv("ORACLE_HOME=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5");
// Let's make a connection
// Replace user_id, password and db with your own settings
if($conn = OCILogon("user_id","password","db"))
{
// Get some info about the db
printf("%s</P>", OCIServerVersion($conn));
}
else
{
printf("Conncetion Failed");
}
?>
it should print some info about the Oracle server that you connected to.
12. Other Stuff to do
If you are connecting to a remote Oracle server you will need to setup your sqlnet.ora and
tnsnames.ora files to point to the location of the remote db. Talk to the Oracle server's DBA to get
a copy of the files and place them in your
$ORACLE_HOME/network/admin/ directory. |
|
| Installing Oracle support to PHP running in Apache Categories : PHP Configuration, Apache, Oracle, Databases, Web Servers | | | Why do i get a "Save As" dialog box when I type in the url of a php3 file Categories : PHP Configuration, PHP, Apache, Web Servers | | | This functions compares the current PHP version with a
desired version. Because of the 3 tiered version system, a
direct compare of a string to phpversion() will not be
accurate. Categories : PHP Configuration, PHP, Variables | | | How can i see the path of the php3.ini file my php3 uses? Categories : PHP, PHP Configuration | | | What is safemode? Categories : PHP, Installation, PHP Configuration | | | Ora_Bind -- bind a PHP variable to an Oracle parameter Categories : PHP, PHP Functions, Oracle | | | normalize fields and strings used in where (command's Sql) Categories : PHP, Databases, Oracle, Functions | | | browscap Categories : PHP Configuration | | | How to limit the number of records returned by an ORACLE query? Categories : Databases, Oracle | | | StoredProcedure, Stored Procedure, Oracle, OCI8, OCI8i Categories : OCI8, Oracle, Databases, PHP | | | Ora_CommitOn Ora_CommitOff commit rollback database SQL Oracle Categories : Oracle, PHP | | | Connecting to Oracle with php3 Categories : Oracle, PHP, Databases | | | Simple class for accessing databases like MSSql Server, Oracle etc by Raju Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle | | | Step by Step installation
manual for PHP4.1.x on Windows 2000 based systems running IIS5
using CGI or ISAPI Categories : PHP, PHP Configuration, PHP Options and Info, Windows 2000 | | | How can I disable the maximum time of execution of a
php3 script? Categories : PHP Configuration, PHP | |
|
|
|