many people have trouble install and configuring php with oci8 support... below is a quick, easy and working way of doing it.Php and apache must be installed already.
All actions has to be done as root user.
First, install rpm for instantclient basic and SDK (previously downloaded from oracle website):
[root@test ~]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm Preparing... ########################################### [100%] 1:oracle-instantclient11.########################################### [100%] [root@test ~]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm Preparing... ########################################### [100%] 1:oracle-instantclient11.########################################### [100%]
next, just run pecl to install oci8 and configure php with it support:
[root@test ~]# pecl install oci8
It will ask you for the librairy folder:
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] :
on a 64bits system, it should be
instantclient,/usr/lib/oracle/11.2/client64/lib
on a 32bits system, it should be
instantclient,/usr/lib/oracle/11.2/client/lib
if you have the following error, verify that you have the sdk installed:
checking Oracle Instant Client SDK header directory... configure: error: Oracle Instant Client SDK header files not found ERROR: `/var/tmp/oci8/configure --with-oci8=instantclient,/usr/lib/oracle/11.2/client' failed
Then, locate your php.ini file
[root@test ~]# find / -type f -name php.ini /etc/php.ini
And add this line:
extension=oci8.so
The last operation is the apache service to restart.
check its status:
[root@test ~]# service httpd status httpd (pid 3173) is running...
stop it
[root@test ~]# service httpd stop Stopping httpd: [ OK ]
restart it:
[root@test ~]# service httpd start Starting httpd: [ OK ]
You're done, time for you to enjoy a coffee :-)
No comments:
Post a Comment