PHP4 How to connect oracle8i _php Tutorial

Source: Internet
Author: User
PHP4 How to connect Oracle 8i (translation)
Sonymusic March 30, 2000

e-mail it to me. I'll talk about my opinion. Previous article


1. Download and install Oracle 8i for Linux.
Fully installed, do not install clients only
Download location: Hot download of Chat.hn.cninfo.net/soft

2. Download PHP3 or PHP4 source code
Download location: www.php.net www.phpuser.com Chat.hn.cninfo.net/soft

3. Configure the PHP installation parameters
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

The--with-oracle option allows PHP to access Oracle 7.x or 8.x via the Ora_ function
--WITH-OCI8 option allows PHP to use more and better oci8 functions

4. Make

5. Make install

6. CP./php.ini-dist/wherever/your/conf/files/are/php.ini
Copy the php.ini to the appropriate location

7. Modify Httpd.conf
Modify the following line
LoadModule Php4_module lib/apache/libphp4.so
Switch
LoadModule php4_module/usr/lib/apache/libphp4.so

8. Restart Apache

9. Test whether the installation of PHP4 is successful
Create a test.php3 content as:

Access it in the browser to see if there is Oracle and ORACLE8 information.
If there is, then congratulations!

10. Start using Oracle's functions now
Setting Oracle Environment variables
Putenv ("Oracle_sid=prod");
Putenv ("oracle_home=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5");

Establish a connection
Modify the current user_id,password,db to fit your configuration
if ($conn = Ocilogon ("user_id", "Password", "DB"))
{
Get information about the database
printf ("%s
", Ociserverversion ($conn));
}
Else
{
printf ("Conncetion Failed");
}
?>
This program will show you some information about the oracle you are connected to.

12. Other
If you need to connect to a remote Oracle server, you'll also need to set up your Sqlnet.ora and Tnsnames.ora to specify the location of the remote database.
Ask your database administrator to copy some files to
$ORACLE the _home/network/admin/directory


http://www.bkjia.com/PHPjc/532011.html www.bkjia.com true http://www.bkjia.com/PHPjc/532011.html techarticle PHP4 connecting Oracle 8i (translation) Sonymusic March 30, 2000 e-mail it to me, and I'll talk about my opinion. Previous next 1. Download and install Oracle 8i for Linux. Fully installed ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.