Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » suse oracle »

Re: [suse-oracle] connecting webserver to oracle database
 server10g

Arun Singh

2007-03-29

Replies:

Agree,

Uwe, Please polish this little bit to get it publish on Cool Solutions
(http://www.novell.com/coolsolutions/appnotes/howto.html). Once
published, we can link this to Novell/Oracle Document section. We need
these kind of solution oriented how-to's.

Thanks,
Arun

>>> On 3/29/2007 at 10:37 AM, "Alexei_Roudnev"
<Alexei_Roudnev@(protected)>
wrote:
> It should be placed onto www.suse.com/oracle -> Documentation .
>
>
> ----- Original Message -----
> From: "Uwe Schaefer" <uwe.schaefer@(protected)>
> To: <suse-oracle@(protected)>
> Sent: Thursday, March 29, 2007 4:54 AM
> Subject: Re: [suse-oracle] connecting webserver to oracle database
server10g
>
>
> Oracle client:
>
> 1. Download the Instant Client from Oracle
> 2. Be sure to get the basic and the sdk package for Linux (the basic
in
> RPM format to install the runtime environment and both the basic and
sdk
> in zip format to be used while compiling)
> 3. Install the RPM package (rpm -i)
> 4. Unzip both zips into the same directory
> 5. cd into the newly created directory (instantclient_10_x) and
create a
> softlink: libclntsh.so -> libclntsh.so.10.1
>
> Apache/PHP:
>
> 1. Install apache2, do not install any PHP packages!
> 2. Install apache2-devel to get apxs2 (also required: libapr1-devel
and
> libapr-utils-devel)
> 3. Download the PHP source code and unzip it
> 4. Use configure as shown in FIG A
> 5. Enter make
> 6. Add the lib-directory generated by the RPM installed before (e.g
> /usr/lib/oracle/10.2.0.3/client/lib) to the LD_LIBRARY_PATH
> 7. Enter make install
> 8. Copy the php.ini-recommended file to your apache config directory
> (e.g. /etc/apache2)
> 9. Create the tnsnames.ora
> 10. cd into your apache config directory
> 11. (for apache 2) create a new file called php5.conf and copy the
> content of FIG D into it
> 12. Be sure to include this conf in your vhost (e.g. Include
> /etc/apache2/conf.d/php5.conf)
> 13. Edit the files containing module information (on SuSE 10.1:
> /etc/sysconfig/apache2) and add the libphp5.so to the list of
modules.
> 14. Start apache with the script from FIG C
> 15. Create a PHP page, only containing <?php phpinfo(); ?>, save it
in
> your DocumentRoot and call it via a web browser. It should now
display
> an OCI8 information section.
> 16. You can now use the code from FIG E to test your Oracle database
> connection
>
>
> FIG A:
> ./configure
>   --with-oci8=instantclient,<LOCATION_OF_UNZIPPED_ORACLE_FILES>
>   --prefix=/usr/local
>   --with-apxs2=/usr/sbin/apxs2
>   --enable-sigchild
>   --with-config-file-path=/etc/apache2
>
> FIG C:
> LD_LIBRARY_PATH=<PATH_TO_LIB_DIR_FROM_RPM>:${LD_LIBRARY_PATH}
> TNS_ADMIN=<PATH_TO_DIR_CONTAINING_TNSNAMES>
> export LD_LIBRARY_PATH TNS_ADMIN
> echo Starting Apache apache2ctl start
>
> FIG D:
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php .phtml
> AddType application/x-httpd-php-source .phps
>
> FIG E:
> <?php
>      $c = OCILogon('<USER_NAME>', '<PASSWORD>',
> '<ALIAS_FROM_TNS_NAMES>');
>      if($c != null){
>           echo "YAY!";
>      } else{
>           echo "DOH!";
>      }
>
> $query = '<SOME_SQL_HERE>';
>
> $stid = OCIParse($c, $query); OCIExecute($stid, OCI_DEFAULT); while
> ($succ = OCIFetchInto($stid, $row)) { foreach ($row as $item) { echo
> $item." "; } echo "<br>n"; }
>
> OCILogoff($c); ?>
>
>
> Trusha wrote:
>> Dear All,
>>
>>  I have a web server running on SuSE Linux ES 10 with Apache(2.2.0)
and
> Php(5.1.2) installed. I have another server on SuSE Linux ES 9 on
which
> Oracle Database 10g R2 in installed. I want to connect my webserver
to
> oracle server. I have following the help available on oracle site but
didn't
> succeed. I have download and install instant client. Can anyone in
this
> group give me step by step help for the connectivity?
>>
>>  Regards
>>  Trusha
>>
>>
>> ---------------------------------
>> Here?s a new way to find what you're looking for - Yahoo!
Answers
>




--
To unsubscribe, email: suse-oracle-unsubscribe@(protected)
For additional commands, email: suse-oracle-help@(protected)
Please see http://www.suse.com/oracle/ before posting

©2008 dba.5341.com - Jax Systems, LLC, U.S.A.