note 44574 modified in ref.oci8 by sixd
| From: | sixd@php.net | Date: | Thu, 10 Apr 2008 22:12:52 +0000 |
| Subject: | note 44574 modified in ref.oci8 by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-138142@lists.php.net to get a copy of this message | ||
ReCompiling PHP4 to have oracle 8 support (oci8) on Debian Linux, using the Oracle 10g client
libraries. Log in as root.
PACKAGES REQUIRED:
php4-dev
php4 (source files)
php4 module (might not be required, but it's what i had installed at the time)
OTHER PACKAGE REQUIREMENTS:
Oracle Client Libraries (i used Oracle 10g Server, but you should be able to use, as has been
previously said, any set of the oracle client libraries from 8i onwards).
* make sure this is installed before recompiling php4.
ENVIRONMENT REQUIREMENTS:
- export ORACLE_HOME=[where u installed the oracle client]
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
- export LD_PRELOAD=libclntsh.so.10.1 (the version number at the end will correspond to the oracle
version you previously installed. in my case, 10g is 10.1).
- vi /etc/ld.so.conf and add $ORACLE_HOME/lib to the list of paths.
then * run ldconfig to reload those changes to the system * (p.s. make sure it's the full path,
and not using any environment variables. e.g. /u01/app/oracle/product/10gRDBMS is my ORACLE_HOME).
STEPS:
- cd /usr/src/[PHP4 Version]
in my case, [PHP4 Version] = php4-4.3.8, so path was
/usr/src/php4-4.3.8
- vi debian/rules
these are the default compilation rules for php4. Find section labeled COMMON_CONFIG = [...] and add
--with-oci8 (it should be near the top of the file).
- debchange -i (allows you to edit the change log for the versions of php. btw - you should be in
the php4 source code directory). give the version id something obviously unique. don't forget
to add a comment.
when all is in readyness, then you should be able to go debian/rules binary to build the debian
packages required.
the deb packages are built into the /usr/src directory. and depending on the default compilation
options u choose, there should be a few. find the deb package that corresponds to the main php4
module (php4_4.3.8-4.mark.1_i386.deb for me), and run dpkg -i [package name] to install it.
- vi /etc/init.d/apache and add exports for $ORACLE_HOME, $LD_PRELOAD and $LD_LIBRARY_PATH
* don't forget to restart apache /etc/init.d/apache to reload the php4 module. *
IF YOU GET... :
if you get an error saying something about apache cannot load libclntsh.so.10.1, file not found,
check the environment variables, for both the user, and in /etc/init.d/apache and also check
ld.so.conf to make sure the $ORACLE_HOME/lib path is in there, and has been reloaded (with
ldconfig).
editing ld.so.conf was the part that finally got it working for me.
as you should be able to tell, the steps are pretty much the same as for all oracle versions 8i
onwards, and all linux OS's. but with a few debian specific paths and commands thrown in.
--was--
ReCompiling PHP4 to have oracle 8 support (oci8) on Debian Linux, using the Oracle 10g client
libraries. Log in as root.
PACKAGES REQUIRED:
php4-dev
php4 (source files)
php4 module (might not be required, but it's what i had installed at the time)
OTHER PACKAGE REQUIREMENTS:
Oracle Client Libraries (i used Oracle 10g Server, but you should be able to use, as has been
previously said, any set of the oracle client libraries from 8i onwards).
* make sure this is installed before recompiling php4.
ENVIRONMENT REQUIREMENTS:
- export ORACLE_HOME=[where u installed the oracle client]
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
- export LD_PRELOAD=libclntsh.so.10.1 (the version number at the end will correspond to the oracle
version you previously installed. in my case, 10g is 10.1).
- vi /etc/ld.so.conf and add $ORACLE_HOME/lib to the list of paths.
then * run ldconfig to reload those changes to the system * (p.s. make sure it's the full path,
and not using any environment variables. e.g. /u01/app/oracle/product/10gRDBMS is my ORACLE_HOME).
STEPS:
- cd /usr/src/[PHP4 Version]
in my case, [PHP4 Version] = php4-4.3.8, so path was
/usr/src/php4-4.3.8
- vi debian/rules
these are the default compilation rules for php4. Find section labeled COMMON_CONFIG = [...] and add
--with-oci8 (it should be near the top of the file).
- debchange -i (allows you to edit the change log for the versions of php. btw - you should be in
the php4 source code directory). give the version id something obviously unique. don't forget
to add a comment.
when all is in readyness, then you should be able to go debian/rules binary to build the debian
packages required.
the deb packages are built into the /usr/src directory. and depending on the default compilation
options u choose, there should be a few. find the deb package that corresponds to the main php4
module (php4_4.3.8-4.mark.1_i386.deb for me), and run dpkg -i [package name] to install it.
- vi /etc/init.d/apache and add exports for $ORACLE_HOME, $LD_PRELOAD and $LD_LIBRARY_PATH
* don't forget to restart apache /etc/init.d/apache to reload the php4 module. *
IF YOU GET... :
if you get an error saying something about apache cannot load libclntsh.so.10.1, file not found,
check the environment variables, for both the user, and in /etc/init.d/apache and also check
ld.so.conf to make sure the $ORACLE_HOME/lib path is in there, and has been reloaded (with
ldconfig).
editing ld.so.conf was the part that finally got it working for me.
as you should be able to tell, the steps are pretty much the same as for all oracle versions 8i
onwards, and all linux OS's. but with a few debian specific paths and commands thrown in.
http://php.net/manual/en/ref.oci8.php