How do you configure OCI8 with PHP
June 18 2014
Oci8 is used for connect to an Oracle database, so you want to install Apache,MySQL and PHP in your Oracle server,
Extract the PHP
tar xvf php-5.4.29.tar.bz2
Next, set the Oracle home path and configure oci8 in PHP
# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
# cd php-5.4.29
# ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/bin/ --with-libdir=lib64 --prefix=/usr/share/php --with-config-file-path=/usr/share/php --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gdbm --with-oci8=$ORACLE_HOME
#make
#make install
# cd php-5.4.29
# ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/bin/ --with-libdir=lib64 --prefix=/usr/share/php --with-config-file-path=/usr/share/php --enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext --with-gdbm --with-oci8=$ORACLE_HOME
#make
#make install
Once the installation has been done you can check the version whether is configured in your PHP
#php –I | grep oci8
or You can check with phpinfo();
I have faced two errors while installing oracle, That errors and solutions given below,
Error1:
ERROR: php configure: cannot find libmysqlclient
Solution:
./configure --with-mysql=/usr/bin/ --with-libdir=lib64
Error2:
ERROR : configure: error: DBA: Could not find necessary header file(s) Solution:
Solution:
yum install gdbm-devel
Comments (0)