How To Install Apache+PHP+Oracle+Win32 Platform
How To Install Apache+PHP+Oracle+Win32 Platform
Purpose:
Describe basic steps for using PHP and Oracle Database on Win32 Platform.
Prerequisites:
Prerequisites:
N/A
Assumption:
- Web Server planed to run on windows2000sp2.
- We tested with Oracle 8.1.7 EE
- Understand PHP OCI8 extension big picture
Attendees:
PHP developer, Oracle Developer
Step-
Step-by-
by-Step Example:
1. Download all stuff
1.1 Download Oracle Software (In case you don't have Oracle Client Software)
1.2 Download Apache for windows
1.3 Download PHP Engine and library files.
3. Manual configuration
3.1 Modify httpd.conf apache configuration file.
3.2 Modify php.ini file for enable oci8 extension.
4. Testing
4.1 Startup and shutdown Apache http Server
4.2 Start your first PHP testing program.
4.2 Check your current environment.
4.3 Creation a simple php program for testing oci extension.
1.1 Download Oracle Software (In case you don't have Oracle Client Software)
If you don't have Oracle Client software, you can download all software from "
http://otn.oracle.com/software/content.html " and install it firstly.
We will start to download Apache http server that is distributed in MSI package.
http://www.apache.org/dist/httpd/binaries/win32/apache_1.3.22-win32-x86.msi
The first one is PHP 4.0.6 installer, it helps us to install and set a lot of default values.
And the second one is PHP 4.0.6 zip package, it consists of many extensions that we
need to use including oci8 extension.
After downloading all above files, your hard disk should have the same files as the
following screen.
E:\download\apache>dir
Volume in drive E is E-EXZILLA
Volume Serial Number is 548B-72A7
Directory of E:\download\apache
E:\download\apache>
Before starting to install and configure apache/PHP engine, Oracle Client software must
be installed and configured. Then you should use SQL*Plus connecting to database
server from the machine that you
plan to use it as application server.
By default, the Apache HTTP Server should be started after finishing installation.
You can access the test page by entering url "http://localhost/" or "http://yourhostname/".
Quite easy to install the PHP engine with Windows Installer program
If you have this problem, don't worry; we can manually configure the Apache httpd.conf
file.
Finished installation PHP engine
Step to install PHP extension is very easy :) just unzip and copy.
And it's time to configure the Apache httpd.conf to make PHP work with Apache HTTP
Server
3. Manually configure
LoadModule php4_module
d:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
;extension=php_mssql.dll
extension=php_oci8.dll
;extension=php_openssl.dll
4. Testing
You can startup and shutdown Apache HTTP Server by using Administrative Tools ->
Services of Windows or use command line as follows.
Starting:
C:\>net stop apache
The Apache service is stopping.
The Apache service was stopped
successfully.
Stopping:
C:\>net start apache
The Apache service is starting.
The Apache service was started
successfully.
PHP provides very useful function for checking our current environment. You can use
your favorite editor and add 1 line of code in your php source file.
<?php
print phpinfo();
?>
</body>
</html>
http://fuju.exzilla.com/fuju/phpinfo.php
or
http://localhost/fuju/phpinfo.php
Click here for downloading the sample code for testing oci8 extension
Note:
When you try to start the Apache HTTP server and then get the following error
messages
or
First choice, you need to put the correct verion of oci.dll (8.1.7) in your currrent PATH
environment.
Second choice, you can copy the correct version of oci.dll from
$ORACLE_HOME/bin/oci.dll (8.1.7) in to APACHE Home.
I use the second choice because I don't need to change path environment that can take
effect to other program that use different oci.dll version.
References:
1. php.net
2. apache.org
3. otn.oracle.com