Php connection to oracle cannot enable oci8 solution (from the oracle official website)

Source: Internet
Author: User
Tags vc9
: This article describes how to enable oci8 for php connection to oracle (from the oracle official website). If you are interested in PHP tutorials, refer to it. Enabling the php OCI8 EXTENSION ON WINDOWS

The Instant Client binaries complement PHP's pre-built binaries for Windows.

  1. Install Apache by downloadinghttpd-2.2.22-win32-x86-no_ssl.msiFrom httpd.apache.org/download.cgi

  2. Double click the MSI file to start the installation wizard.

    Install "for All Users, on Port 80". Do a typical install into the default destination folder:C:\Program Files\Apache Software Foundation\Apache2.2.

  3. Download the FastCGI componentmod_fcgid-2.3.6-win32-x86.zipFrom httpd.apache.org/download.cgi?mod_fcgid

  4. Unzip it to the installed Apache 2.2 directory.C:\Program Files\Apache Software Foundation\Apache2.2\modulesDirectory shocould now havemod_fcgid.soAndmod_fcgid.pdbFiles.

  5. EditC:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.confAnd add the line:

    LoadModule fcgid_module modules/mod_fcgid.so
  6. Inhttpd.conf, Locate

    SectionhtdocsAnd addExecCGIToOptions:

       
        ...Options Indexes FollowSymLinks ExecCGI...
       
  7. Install PHP by downloading the PHP 5.4.0 "VC9 x86 Non Thread Safe" ZIP packagePhp-5.4.0-nts-Win32-VC9-x86.zipFromwindows.php.net/download.

  8. In Windows Explorer unzip the PHP package to a directory calledC:\php-5.4.0

  9. InC:\php-5.4.0Copyphp.ini-developmentTophp.ini

  10. Editphp.iniTo make the following changes:

    • Add a timezone line like:

      date.timezone = America/Los_Angeles


      Use your local timezone name.

    • Add the line:

      extension_dir = C:\php-5.4.0\ext


      This is the directory containing the PHP extensions.

    • Remove the semicolon from the beginning of the line:

      extension=php_oci8_11g.dll
  11. EditC:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.confAnd add the following lines. Make sure you use forward slashes'/And not back slashes'\':

    FcgidInitialEnv PHPRC "c:/php-5.4.0"AddHandler fcgid-script .phpFcgidWrapper "c:/php-5.4.0/php-cgi.exe" .php
  12. Download the "Instant Client Package-Basic" for Windows from the OTN Instant Client page. Because PHP is 32 bit, use the 32 bit version of Instant Client.

    Unzip the Instant Client filesC:\instantclient_11_2

  13. Edit the WindowsPATHEnvironment setting and addC:\instantclient_11_2. For example, on Windows XP, follow Start-> Control Panel-> System-> Advanced-> Environment Variables and editPATHIn the System variables list.

    Commonly you need to reboot Windows so the new environment is correctly set.

    Set desired Oracle globalization language environment variables suchNLS_LANG. If nothing is set, a default local environment will be assumed. See the Globalization chapter in The Underground PHP and Oracle Manual for more details.

    Unset Oracle variables suchORACLE_HOMEAndORACLE_SID, Which are unnecessary with Instant Client.

    If you have other Oracle software on the computer then instead of modifying the Windows environment, write a script that sets these values and starts Apache. Otherwise library symbol clashes are likely because of version differences.

  14. Restart Apache using the system tray Apache Monitor or the Start menu option.

The above describes how to enable oci8 for php connection to oracle (from the oracle official website), including content, and hope to help friends who are interested in PHP tutorials.

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.