Enabling the PHP OCI8 EXTENSION on WINDOWS
The Instant Client binaries complement PHP ' s pre-built binaries for Windows.
Install Apache by downloading from httpd-2.2.22-win32-x86-no_ssl.msi
httpd.apache.org/download.cgi
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
.
Download the FastCGI component from mod_fcgid-2.3.6-win32-x86.zip
Httpd.apache.org/download.cgi#mod_fcgid
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.
Edit and add the line C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
:
LoadModule Fcgid_module modules/mod_fcgid.so
httpd.conf
in, locate the
section for and add to the htdocs
ExecCGI
Options
:
... Options Indexes followsymlinks execcgi ...
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.
In Windows Explorer unzip the PHP package to a directory calledC:\php-5.4.0
In C:\php-5.4.0
copy php.ini-development
tophp.ini
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
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
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
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.
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.