Purpose: Describe basic step for using PHP and Oracle Database on Win32 Platform.
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-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. 2. Install all stuff 2.1 Install Oracle Client Software. 2.1.1 step-by-step to install Client Software 2.1.2 Configure Oracle Client network 2.1.3 Test the Oracle Client connection with your database server 2.2 Install Apache http server for windows 2.2.1 step-by-step to install Apache http Server 2.2.2 Test the Apache http Server 2.3 Install PHP engine 2.3.1 step-by-step to install PHP engine 2.3.2 step-by-step to install PHP extension 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. Download all stuff 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 please install it first. 1.2 Download Apache for windows 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 1.3 Download PHP Engine and library files. And then go to http://www.php.net/downloads.php for downloading windows binary files of PHP engine On download page at php.net you should found 2 separate files. 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. You should download both files. 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 10/19/2001 03:55p <DIR> . 10/19/2001 03:55p <DIR> .. 10/19/2001 04:22p 2,104,832 apache_1.3.22-win32-x86.msi 10/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. Install all stuff 2.1 Install Oracle Client 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. 2.2 Install Apache http Server for windows 2.2.1 step-by-step to install Apache http Server 2.2.2 Test the Apache http Server By default, the Apache http Server should be started after finishing installation. You can access the test page by " http://localhost/ " or " http://yourhostname/ ". 2.3 Install PHP engine 2.3.1 step-by-step to install PHP engine 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 2.3.2 step-by-step to install PHP extension Step to install PHP extension is very easy :) just unzip and copy. 2.3.2.1 unzip php-4.0.6-Win32.zip to D:\PHP 2.3.2.2 copy d:\php\php4ts.dll to c:\winnt\system32 D:\PHP>copy php4ts.dll c:\winnt\system32 1 file(s) copied. D:\PHP> And it's time to configure the Apache httpd.conf to make PHP work with Apache http Server 3. Manually configure 3.1 Modify httpd.conf apache configuration file. Add the following line to "D:/Program Files/Apache Group/Apache/conf/http.conf" at the bottom line of that file. LoadModule php4_module d:/php/sapi/php4apache.dll AddType application/x-httpd-php .php 3.2 Modify php.ini file for enable oci8 extension. Uncomment the php_oci8.dll line in c:\winnt\php.ini ;extension=php_mssql.dll extension=php_oci8.dll ;extension=php_openssl.dll Edit extension_dir Location ; Directory in which the loadable extensions (modules) reside. extension_dir = "D:\PHP\extensions" 4. Testing 4.1 Startup and shutdown Apache http Server You can startup and shutdown Apache http server by using Administrative Tools -> Services of Windows or command line. 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. 4.2 Start your first PHP testing program. 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. My php file looks like this C:\> type "D:/Program Files/Apache Group/Apache/htdocs/fuju/phpinfo.php" <html> <body> <?php print phpinfo(); ?> </body> </html> And then test the above PHP program. http://fuju.exzilla.com/fuju/phpinfo.php or http://localhost/fuju/phpinfo.php The OCI8 enabled should like this 4.3 Creation a simple php program for testing oci8 extension. Click here for downloading the sample code for testing oci8 extension Note: When you tried to start the Apache http server and then got the following error messages. "The procedure entry point OCILobOpen could not be located in the dynamic link library OCI.dll." or "Unable to load dynamic library 'D:\PHP\extensions/php_oci8.dll' - The specified procedure could not be found." What's wrong? You may have wrong version of oci.dll in your PATH environment. How to solve it? 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've used the second choice because I don't need to change path environment that can take effect to other program that use differenct oci.dll version. > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] > Behalf Of ade trisna > Sent: 16 Juni 2006 18:57 > To: [email protected] > Subject: [indo-oracle] KONEK PHP-ORACLE > > > salam... > > gimana ya cara koneksi oracle - php di windows syarat apa aja > yang harus dipenuhi > maklum nih aku pemula yang lagi mo nyoba oracle di php > syukur-syukur kalo ada yang bisa ngirimin artikelnya... > thanks ya atas pencerahannya... :) > > ade trisna ------------------------ Yahoo! Groups Sponsor --------------------~--> Check out the new improvements in Yahoo! Groups email. http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/PhFolB/TM --------------------------------------------------------------------~-> -- -----------I.N.D.O - O.R.A.C.L.E--------------- Keluar: [EMAIL PROTECTED] Website: http://indo-oracle.blogspot.com Mirror: http://indooracle.wordpress.com ----------------------------------------------- Bergabung dengan Indonesia Thin Client User Groups, Terminal Server, Citrix, New Moon Caneveral, di: http://indo-thin.blogspot.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indo-oracle/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

