الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Linux+oracle+php+apach

مغلق
بدأه Muawia في 14 نوفمبر 2002 · 11 رد · 1,417 مشاهدة · في قواعد بيانات Oracle
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Hello every one...any one intersted to know how to install ORACEL 8i under linux red hat 6.2 and (php+apache web server) integration?....If you need hellp let me know...I will be more than happy to help you...sorry I dont have arabic windows here I will try my best to get one soon....

--Muawia

#2

مشكور أخي على الشعور الطيب، وأتمنى ان تقوم بكتابة المواضيع في شكل دروس وعرضها ليستفيد الكل

#3

اخي الفاضل ياريت لو تشرح طريقة تشغيل الاوركال مع red had 7 و بيان اي نسخة من الاوركال تعمل معه

جازاك الله خير

#4

فكرة ممتازة ياريت تتكرم وتشرح لنا هذا الموضوع

#5

Dear friend...I will start with installing oracle under linux then we will go step by step on how to integrate php and apatch with oracle...LETS GOD!

first of all you need the following componants..:

oracle 8.1.6 or 8.1.7 (I used oracle 8.1.6) for LINUX MAKE SURE IT IS FOR LINUX you can download it from www.oracle.com for free!.....the sec. thing you need is REDHAT 6.2 make sure it is 6.2 (7.1,,,7.2) will not work with this becasue of incompatabily of libraries of those 7.1 ,7.2 so to save alot of time use REDHAT 6.2;

Oracle Pre-Install

In this section, we create the necessary user groups and accounts which will ultimately manage the oracle software..

Set up Oracle account and group

Two groups and one account need to be created to install Oracle.

1) If you are not already logged in as root, log in now.

2) If you don't have a terminal window already open, open one.

3) In the terminal window, create your groups. oinstall is used to install the software, while dba will be your database administrators group and oper will be your management group.

groupadd oinstall

groupadd dba

groupadd oper

4) Create the oracle user with oinstall as the primary group and dba and oper as the secondary groups.

useradd oracle -g oinstall -G dba,oper

passwd oracle (to change password)

5) If you didn't make mount points with disk partitioning, make a directory for oracle, such as /u01.

mkdir /u01. (You can also fake the OFA-compliancy by mkdir /u01, /u02, /u03 and /u04.

6) Change owner and group permissions on these mount points.

chown oracle.dba /u01 (run same command for /u02, /u03 and /u04 if you have them)

chmod 775 /u01 (run same command for /u02, /u03 and /u04 if you have them)

7) Log out.

Setting up the oracle user's environment

1) Log in as oracle.

2) If you don't have a terminal window open, open one now.

3) Verify umask is 022 by typing umask [enter]. If it is, great. If not, you'll need to put it in .bash_profile, which we edit in the next step.

4) Use your favorite editor to edit the .bash_profile file in your oracle account's home directory. Put the following lines in this file:

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=/u01/app/oracle/product/8.1.6; export ORACLE_HOME

ORACLE_SID=ora1; export ORACLE_SID

PATH=$PATH:/u01/app/oracle/product/8.1.6/bin; export PATH

CLASSPATH=.:/u01/app/oracle/product/8.1.6/jdbc/lib/classes111.zip; export CLASSPATH

LD_LIBRARY_PATH=/u01/app/oracle/product/8.1.6/lib; export LD_LIBRARY_PATH

(optional) umask 022 (only if umask does not default to 022)

5) There is one more environment variable you might need to add to your .bash_profile. If you are NOT using US English, you will need to add the ORA_NLS33 and the NLS_LANG variables. ORA_NLS33 is the same value for all languages. NLS_LANG depends on which language set you want to use. Here are the available values (use the quotes in your NLS_LANG variable if they appear below):

In my case, if I decided to add them for US English anyway, I would put the following in my .bash_profile:

ORA_NLS33=/u01/app/oracle/product/8.1.6/ocommon/nls/admin/data; export ORA_NLS33

NLS_LANG=american; export NLS_LANG

#6

Oracle Install

After all that setup, it's finally time to install software!

1) Make sure your logged in as oracle.

2) In a terminal window, change to the directory containing the Oracle software.

cd /usr/src/Oracle8iR2

2) Start the installer

./runInstaller

3) A GUI window appears. Welcome to the Java-based Oracle installer.

4) Click the Next button.

5) Verify that the Source path says /usr/src/Oracle8iR2/stage/products.jar

6) The Destination path should be the same as your $ORACLE_HOME environment variable.

7) Click Next.

8) At the Unix Group Name window, enter "oinstall" as the group, then click Next.

9) A window will now pop up asking you to run the orainstRoot.sh script. Here is how to do that:

Open a new terminal window

su root (enter your password)

cd $ORACLE_HOME

./orainstRoot.sh

Leave this window open and at the root level.

10) Go back to that popup window that appeared and click the Retry button.

11) You will now get the Available Products screen. Select Oracle 8i 8.1.6.1.0 and click Next.

12) On the next screen, select Typical, then Next.

13) You will then be prompted for a global database name. This usually consists of a name you create, followed by your domain name. If you're just a home user, this might be something like oracle.localdomain. Since my domain here at work is fortwayne.com and this will be for web work, I'll name it oraweb.fortwayne.com. The one limit to the global database name is that the name itself must be eight characters or less.

14) Verify the ORACLE_SID is correct, then click Next.

15) The next prompt asks for a db files location. If you just created one mount point, this will be /u01. Enter it in here and click Next.

16) Finally, at the summary window, Click the Install button.

17) The software begins installing! Woo-woo!

18) After files have been copied and linked, you will get another pop-up asking you to run the root.sh script.

Go back to the terminal window that is running at the root level.

cd $ORACLE_HOME

./root.sh

Just hit Enter when it asks for the Path to your local bin directory

exit (to exit superuser privileges)

exit (to exit the terminal window)

19) Return to that pop-up window and hit OK.

20) The Oracle Net8 Configuration and Oracle Database Configuration Assistants now start. Both of these are pretty straightforward and don't ask you to do anything. Creating the database could take a while on slower machines.

21) When the Database Configuration Assistant finishes, you will get a pop-up saying Database creation completed. Just hit OK.

22) You are now at the End of Installation screen. Hit Exit.

23) Confirm that you want to exit.

24) All the software you need is now on the machine. If you want to do the optional post-install stuff, move on. Otherwise, you're set to go!

IMPORTANT! Default passwords

Oracle installed two accounts off the bat for administering the database. Here are the names and passwords for both:

sys - change_on_install

system - manager

--------------------------------------------------------------------------------

Oracle post-install (optional)

These steps will get the TNS listener up and running and will also install the sample tables. Do them only if you want or need to.

1) Use the same terminal window that you used to run the installer.

2) If you want to access the Oracle server with the GUI management tools from another PC, you will need to start the TNS listener. The default config works for most TCP/IP installations, but you may need to change it. It worked for us.

lsnrctl start

3) The Oracle Server should be running. If not, you can start it with the following commands:

svrmgrl

connect internal

startup

quit

4) If you want to set up the sample tables for user scott/tiger, you can do it this way:

cd $ORACLE_HOME/rdbms/admin

sqlplus (Connect as sys)

@utlsampl.sql

5) Now start SQLPlus and login as user scott and password tiger. Do a select * from emp and you should get some records back. Everthing is up and running!

#7

ikhawany ana mot2asef 3ala il ketaba bel englizy...BUT I HAVE NO OTHER CHOICE...any how I hope it is clear if you need help please email me (moawyahr@hotmail.com) or ask me on this forum next time I will show you how to install apach and php so we can integrat them togather to work with oracle! enjoy what did i type today !

AKhokom Muawia Alaraj

#8

ikhowan akmel wela la2?

:( :( :o

#9

السلام عليكم

اخي معاويه

ارجوا ان تكمل الموضوع

شكرا لك وجزاك الله خيرا

عمر باعقيل

كندا - مونتريال

baaqeel@arabteam2000.com

#10

# Build a new apache (httpd) from the source file apache_1.3.12.tar.gz

cd /usr/local

tar xzvf apache_1.3.12.tar.gz

cd apache_1.3.12

# set the oracle environment

export ORACLE_HOME=/opt/u01/app/oracle/product/8.1.5

export ORACLE_SID=lin2

export TNS_ADMIN=/opt/u01/app/oracle/product/8.1.5/network/admin

export LD_LIBRARY_PATH=/opt/u01/app/oracle/product/8.1.5/lib

# set the linker environment

export LIBS="-L/opt/u01/app/oracle/product/8.1.5/lib -lclntsh"

# then configure and make PHP4

# this must be done before compiling Apache because it will put the php-library

# into the apache build directory

cd /usr/local

tar xzvf php-4.0.0.tar.gz

cd php-4.0.0

./configure --with-apache=/usr/local/apache_1.3.12 --enable-track-vars --with-o$

make

make install # this will put files into /usr/local/apache_1.3.12/src/modules/ph$

# then go back to apache and compile it with the php-lib

#

cd /usr/local/apache_1.3.12

# the prefix defines the output directory where the "make install" step puts al$

# the new apache will be completely under this directory - different from the R$

# it is the only directory that is written to outside of /apache_1.3.12

./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libph$

make

make install

# if you see the following text you're done:

+--------------------------------------------------------+

| You now have successfully built and installed the |

| Apache 1.3 HTTP server. To verify that Apache actually |

| works correctly you now should first check the |

| (initially created or preserved) configuration files |

| |

| /usr/local/apache/conf/httpd.conf

| |

| and then you should be able to immediately fire up |

| Apache the first time by running: |

| |

| /usr/local/apache/bin/apachectl start

| |

| Thanks for using Apache. The Apache Group |

| http://www.apache.org/ |

+--------------------------------------------------------+

# if the "original" apache from the Redhat RPM install is still running

# it is now time to shut it down and forget about it.

/etc/rc.d/init.d/httpd stop

# now configure it. Edit the file /usr/local/apache/conf/httpd.conf

# and add or uncomment the line

AddType application/x-httpd-php .php

# It might also be necessary to specify the Host name, e.g.

ServerName www-server

# the fire up the new apache

/usr/local/apache/bin/apachectl start

# test it

# in /usr/local/apache/htdocs creat a file info.php:

cat > /usr/local/apache/htdocs/info.php

<?phpinfo()?>

Ctrl-D

# in the browser connect to

www-server/info.php

# this should give you the php4-configuration page.

# Check the Environment for the Oracle variables!

# to test the oracle connection create another php-file:

cat > /usr/local/apache/htdocs/ora.php

<?php

$id = ora_logon("scott@lin2","tiger");

dba_close($id);

?>

#11

One more note: For the connection to work the Oracle environment variables

must be set correctly at the time you MAKE the apache (see above)!

The environment variables at make time will be copied into the environment

of the httpd daemon and the oracle code will read them from there.

It is not necessary to set the variables in the Apache environment using

SetEnv (and it won't help either). This is a noteworthy difference to

the dynamic library setup, where you can set the oracle environment in

the httpd.conf using SetEnv.

#12

Many Thanks Mr.Muawia :)

هذا الموضوع مغلق.

مواضيع مشابهة