This article provides a detailed analysis of how to install Apache + PHP to connect to Oracle in Linux. if you need a friend, refer to Oracle and choose CentOS for Linux.
1. install httpd (apache)
Yum install httpd-y
2. install php, php-gd, php-mcrypt, php-pecl *
Yum install php-gd php-mcrypt php-pecl *-y
3. install oci8
Pecl install oci8
Enter the oracle installation directory during installation
4. modify httpd. conf
Find
User apache
Group apache
Change to a user in the system, for example:
User oracle
Group oracle
5. create oracle. ini under/etc/php. d:
; Enable oracle extension module
Extension = oci8.so
6. modify the temporary directory of php (/etc/php. ini:
Session. save_path = "/tmp/php"
And minimize/tmp/php permissions to chmod 777/tmp/php
7. set the environment variable. bash_profile
ORACLE_HOME =/opt/oracle/product/11.2.0/dbhome_1/
LD_LIBRARY_PATH =/opt/oracle/product/11.2.0/dbhome_1/lib
TNS_ADMIN =/opt/oracle/product/11.2.0/dbhome_1/network/admin
ORACLE_SID = orcl
Export ORACLE_HOME LD_LIBRARY_PATH TNS_ADMIN ORACLE_SID
8.
Chkconfig -- level 3 httpd on
Chkconfig -- level 5 httpd on
9. reboot