How to Install Apache+PHP+Oracle+Win32 Platform
Transcript of How to Install Apache+PHP+Oracle+Win32 Platform
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
1/20
HowtoinstallHowtoinstallHowtoinstallHowtoinstallApache/PHPforworkingwithOracleDatabaseApache/PHPforworkingwithOracleDatabaseApache/PHPforworkingwithOracleDatabaseApache/PHPforworkingwithOracleDatabaseononononWin32PlatformWin32PlatformWin32PlatformWin32Platform
Jan29,2002
Teddy
Author'sBio|E-Mail
Copyright(C)2004exzilla.net
Purpose:Purpose:Purpose:Purpose:DescribebasicstepsforusingPHPandOracleDatabaseonWin32Platform.
PrerequisitePrerequisitePrerequisitePrerequisites:s:s:s:N/A
Assumption:Assumption:Assumption:Assumption:
-WebServerplanedtorunonwindows2000sp2.-WetestedwithOracle8.1.7EE- Understand PHP OCI8 extension big picture
Attendees:Attendees:Attendees:Attendees:PHPdeveloper,OracleDeveloper
StepStepStepStep----bybybyby----StepExample:StepExample:StepExample:StepExample:1.Downloadallstuff1.1DownloadOracleSoftware(Incaseyoudon'thaveOracleClientSoftware)1.2DownloadApacheforwindows
1.3DownloadPHPEngineandlibraryfiles.
2.Installallstuff2.1InstallOracleClientSoftware.2.1.1Step-by-steptoinstallClientSoftware2.1.2ConfigureOracleClientnetwork2.1.3TesttheOracleClientconnectionwithyourdatabaseserver2.2InstallApachehttpserverforwindows2.2.1Step-by-steptoinstallApachehttpServer2.2.2TesttheApachehttpServer
2.3InstallPHPengine2.3.1Step-by-steptoinstallPHPengine2.3.2Step-by-steptoinstallPHPextension
3.Manualconfiguration3.1Modifyhttpd.confapacheconfigurationfile.3.2Modifyphp.inifileforenableoci8extension.
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
2/20
4.Testing4.1StartupandshutdownApachehttpServer4.2StartyourfirstPHPtestingprogram.4.2Checkyourcurrentenvironment.4.3Creationasimplephpprogramfortestingociextension.
1.Downloadallstuff1.Downloadallstuff1.Downloadallstuff1.Downloadallstuff1.1 DownloadOracleSoftware(Incaseyoudon'thaveOracleClientSoftware)
Ifyoudon'thaveOracleClientsoftware,youcandownloadallsoftwarefrom"http://otn.oracle.com/software/content.html"andinstallitfirstly.
1.2 DownloadApacheforwindows
WewillstarttodownloadApachehttpserverthatisdistributedinMSIpackage.
http://www.apache.org/dist/httpd/binaries/win32/apache_1.3.22-win32-x86.msi
1.3 DownloadPHPEngineandlibraryfiles.
Andthengotohttp://www.php.net/downloads.phpfordownloadingwindowsbinaryfilesofPHPengine.
Ondownloadingpageatphp.net,youshouldfind2separatedfiles.
ThefirstoneisPHP4.0.6installer,ithelpsustoinstallandsetalotofdefaultvalues.
AndthesecondoneisPHP4.0.6zippackage,itconsistsofmanyextensionsthatweneedtouseincludingoci8extension.
Youshoulddownloadbothfiles.
Afterdownloadingallabovefiles,yourharddiskshouldhavethesamefilesasthefollowingscreen.
E:\download\apache>dir
Volume in drive E is E-EXZILLA
Volume Serial Number is 548B-72A7
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
3/20
Directory of E:\download\apache
10/19/2001 03:55p .
10/19/2001 03:55p ..
10/19/2001 04:22p 2,104,832
apache_1.3.22-win32-x86.msi10/19/2001 04:36p 4,975,264 php-4.0.6-
Win32.zip
10/19/2001 04:33p 773,192 php406-
installer.exe
3 File(s) 7,853,288 bytes
2 Dir(s) 7,066,619,904 bytes free
E:\download\apache>
2.Installallstuff2.Installallstuff2.Installallstuff2.Installallstuff2.1InstallOracleClientBeforestartingtoinstallandconfigureapache/PHPengine,OracleClientsoftwaremustbeinstalledandconfigured.ThenyoushoulduseSQL*Plusconnectingtodatabaseserverfromthemachinethatyouplantouseitasapplicationserver.2.2InstallApachehttpServerforwindows
2.2.1Step-by-steptoinstallApachehttpServer
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
4/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
5/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
6/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
7/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
8/20
2.2.2TesttheApachehttpServer
Bydefault,theApacheHTTPServershouldbestartedafterfinishinginstallation.
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
9/20
Youcanaccessthetestpagebyenteringurl"http://localhost/"or"http://yourhostname/".
2.3InstallPHPengine2.3InstallPHPengine2.3InstallPHPengine2.3InstallPHPengine
2.3.1Step-by-steptoinstallPHPengine
QuiteeasytoinstallthePHPenginewithWindowsInstallerprogram
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
10/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
11/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
12/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
13/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
14/20
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
15/20
Ifyouhavethisproblem,don'tworry;wecanmanuallyconfiguretheApachehttpd.conffile.
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
16/20
FinishedinstallationPHPengine
2.3.2Step-by-steptoinstallPHPextension
SteptoinstallPHPextensionisveryeasy:)justunzipandcopy.
2.3.2.1Unzipphp-4.0.6-Win32.ziptoD:\PHP
2.3.2.2Copyd:\php\php4ts.dlltoc:\winnt\system32
D:\PHP>copy php4ts.dll c:\winnt\system32
1 file(s) copied.
D:\PHP>
Andit'stimetoconfiguretheApachehttpd.conftomakePHPworkwithApacheHTTP
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
17/20
Server
3.Manuallyconfigure3.Manuallyconfigure3.Manuallyconfigure3.Manuallyconfigure
3.1Modifyhttpd.confapacheconfigurationfile.
Addthefollowinglinesto"D:/ProgramFiles/ApacheGroup/Apache/conf/http.conf"atthebottomlineofthatfile.
LoadModule php4_module
d:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
3.2Modifyphp.inifiletoenableoci8extension.
Uncommentthephp_oci8.dlllineinc:\winnt\php.ini
;extension=php_mssql.dll
extension=php_oci8.dll
;extension=php_openssl.dll
Editextension_dirLocation; Directory in which the loadableextensions (modules) reside.
extension_dir = "D:\PHP\extensions"
4.Testing4.Testing4.Testing4.Testing4.1StartupandshutdownApacheHTTPServerYoucanstartupandshutdownApacheHTTPServerbyusingAdministrativeTools->ServicesofWindowsorusecommandlineasfollows. Starting:
C:\>net stop apache
The Apache service is stopping.
The Apache service was stopped
successfully.
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
18/20
Stopping:
C:\>net start apache
The Apache service is starting.
The Apache service was started
successfully.
4.2StartyourfirstPHPtestingprogram.PHPprovidesveryusefulfunctionforcheckingourcurrentenvironment.Youcanuseyourfavoriteeditorandadd1lineofcodeinyourphpsourcefile. Myphpfilelookslikethis
C:\> type D:/Program Files/Apache
Group/Apache/htdocs/fuju/phpinfo.php
AndthentesttheabovePHPprogram.http://fuju.exzilla.com/fuju/phpinfo.php
or
http://localhost/fuju/phpinfo.php
TheOCI8enabledshouldlikethis
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
19/20
4.3Creationasimplephpprogramfortestingoci8extension.
Clickherefordownloadingthesamplecodefortestingoci8extension
Note:Note:Note:Note:
WhenyoutrytostarttheApacheHTTPserverandthengetthefollowingerror
messages
"TheprocedureentrypointOCILobOpencouldnotbelocatedinthedynamiclinklibraryOCI.dll."
or"UnabletoloaddynamiclibraryD:\PHP\extensions/php_oci8.dllThespecifiedprocedurecouldnotbefound."
-
8/14/2019 How to Install Apache+PHP+Oracle+Win32 Platform
20/20
What'swrong?What'swrong?What'swrong?What'swrong?
Youmayhavewrongversionofoci.dllinyourPATHenvironment.
Howtosolveit?Howtosolveit?Howtosolveit?Howtosolveit?
Firstchoice,youneedtoputthecorrectverionofoci.dll(8.1.7)inyourcurrrentPATHenvironment.
Secondchoice,youcancopythecorrectversionofoci.dllfrom$ORACLE_HOME/bin/oci.dll(8.1.7)intoAPACHEHome.
IusethesecondchoicebecauseIdon'tneedtochangepathenvironmentthatcantakeeffecttootherprogramthatusedifferentoci.dllversion.
References:References:References:References:
1.php.net2.apache.org3.otn.oracle.com