The linked page describes it very well. Just a quick note for myself in case the original post disappears:
- Add the necessary APT repository:
echo "# Oracle repositories for debian unstable
deb http://oss.oracle.com/debian unstable main non-free" > /etc/apt/sources.list.d/unstable-oracle.list
And the repository key:
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O - | sudo apt-key add -
Update the APT package cache:
sudo apt-get update
- Get the necessary packages:
sudo apt-get install build-essential php5-dev php5 php-pear oracle-xe-client apache2 libapache2-mod-php5
- Set the Oracle environment variables (this might not be necessary, but I did it anyway):
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client
LD_LIBRARY_PATH=$ORACLE_HOME/lib
TNS_ADMIN=/etc/oracle
NLS_LANG=AMERICAN_AMERICA.UTF8
export ORACLE_HOME LD_LIBRARY_PATH TNS_ADMIN NLS_LANG
- Compile the extension with PECL:
pecl install oci8
It will ask you for your Oracle directory. First enter "1", then enter the directory path (at the moment it's /usr/lib/oracle/xe/app/oracle/product/10.2.0/client
).
- Create a php.ini for OCI8:
echo "extension=oci8.so" > /etc/php5/conf.d/oci8.ini
- Restart Apache:
invoke-rc.d apache2 restart
It should work by now. Test the extension.
A little help on the road:
Recent comments
1 year 43 weeks ago
3 years 12 weeks ago
3 years 13 weeks ago
3 years 15 weeks ago
3 years 16 weeks ago
3 years 22 weeks ago
3 years 22 weeks ago
3 years 22 weeks ago
3 years 23 weeks ago
3 years 23 weeks ago