PHP connection Oracle cannot enable OCI8 solution (from Oracle website)

Source: Internet
Author: User
Tags vc9
Enabling the PHP OCI8 EXTENSION on WINDOWS

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

  1. Install Apache by downloading from httpd-2.2.22-win32-x86-no_ssl.msi 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 component from mod_fcgid-2.3.6-win32-x86.zip Httpd.apache.org/download.cgi#mod_fcgid

  4. Unzip it to the installed Apache 2.2 directory. The C:\Program Files\Apache Software Foundation\Apache2.2\modules directory should now has mod_fcgid.so and mod_fcgid.pdb files.

  5. Edit and add the line C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf :

    LoadModule Fcgid_module modules/mod_fcgid.so
  6. httpd.confin, locate the

    section for and add to the htdocs ExecCGI Options :

      
        
         
       ... Options Indexes followsymlinks execcgi ...
      
        
  7. Install php by downloading the PHP 5.4.0 "VC9 x86 Non Thread Safe" ZIP package php-5.4.0-nts-win32-vc9-x86.z IP fromwindows.php.net/download.

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

  9. In C:\php-5.4.0 copy php.ini-development tophp.ini

  10. Edit to make the php.ini 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. Edit and C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf Add the following lines. Make sure 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 the + bit, use the-the-version of the Instant Client.

    Unzip the Instant Client files toC:\instantclient_11_2

  13. Edit the Windows PATH environment setting and add C:\instantclient_11_2 . For example, on Windows XP, follow Start, Control Panel, System-I, Environment variables and edit in the PATH System variables list.

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

    Set desired Oracle Globalization language environment variables such as NLS_LANG . If Nothing is set, a default local environment would be assumed. See the globalization chapter in the underground PHP and Oracle Manual for more details.

    Unset Oracle variables such ORACLE_HOME ORACLE_SID as and, which is unnecessary with Instant Client.

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

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

The above describes the PHP connection to Oracle cannot enable the OCI8 solution (from the Oracle website), including the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.