WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Configuring PHP 4 with Oracle support
Categories : PHP Configuration, Oracle Update Picture
David Nagel
Date : Mar 09th 2000
Grade : 3 of 5 (graded 1 times)
Viewed : 9676
File : No file for this code example.
Images : No Images for this code example.
Search : More code by David Nagel
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

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
StoredProcedure, Stored Procedure, Oracle, OCI8, OCI8i
Categories : OCI8, Oracle, Databases, PHP
normalize fields and strings used in where (command's Sql)
Categories : PHP, Databases, Oracle, Functions
PHP CLASS for ORACLE (database connectivity)
Categories : PHP, PHP Classes, Classes and Objects, Databases, Oracle
browscap
Categories : PHP Configuration
Connecting to Oracle with php3
Categories : Oracle, PHP, Databases
A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
What is safemode?
Categories : PHP, Installation, PHP Configuration
How can i see the path of the php3.ini file my php3 uses?
Categories : PHP, PHP Configuration
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 to overide the Max_file_size barier
Categories : PHP, PHP Configuration, Filesystem
How to limit the number of records returned by an ORACLE query?
Categories : Databases, Oracle
What to do if PHP3 doesn't find your FreeType library.
Categories : PHP Configuration, Installation, PHP
How can I disable the maximum time of execution of a php3 script?
Categories : PHP Configuration, PHP
Persistent Connections and Oracle
Categories : Oracle