ok I want to connect to my schools Oracle database and so I follow this https://help.ubuntu.com/community/PHPOracle tuturial to install the oracle client. and it makes and oci8.so and puts is in /usr/lib/php5...
and so I edit the php.ini file extension_dir to the location where all the .so files are including the one oci8.so and add the line extension=oci.so but after countless tries the oci8 modules wont load. If anyone has any advice or knows whats going I could definately use the help.
[RESOLVED] oci8.so apache2 how do I get it working
Hi,
which error do you get exactly ? Check the apache error_log for oci8 related errors.
What do you get if you execute
ldd /usr/lib/php5/oci8.so
You wrote that you added extension=oci.so. Is this a typo since that should be extension=oci8.so ?
Did you set the oracle environment variables ? Otherwise, the oracle client wouldn't be able to resolve your oracle connection settings.
Thomas
- Yeah it was a typo sorry about that
- These are the errors I am getting related to oci8.so
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0
- I didn't set any environment variables. What envvariables do I need to set for oci8?
You need to install the libaio package (sudo apt-get install libaio). The oracle client depends on that package.
How does the directory structure in instantclient_10_2 look like ?
ok the oci8.so is showing up now
here is what the directory looks like
/opt/oracle/instantclient/instantclient_11_1$ ls
adrci libclntsh.so libocci.so.11.1 ojdbc5.jar
BASIC_README libclntsh.so.11.1 libociei.so ojdbc6.jar
genezi libnnz11.so libocijdbc11.so sdk
all are files except sdk which is a directory
oh and when I try and connect to the remote server I get
ORA-12514: TNS:listener does not currently know of service
Ok,
forget about the environment variables, since you're using the instant client. Instead use the easy connect naming method with oci_connect, that is something like this:
oci_connect("user", "pass", "//dbhost[:port]/servicename");
dbhost is the hostname or ip address of the oracle database server
: port is optional if your installation of oracle uses another port than the standard 1521 one
servicename ist the name of the oracle service you want to connect to.
I didn't use the easy connect naming method myself so far since I always had a complete oracle client installation including the network/admin directory with tnsnames.ora and sqlnet.ora. But it should work.
Thomas
Make sure that the listener.ora and tnsnames.ora on the oracle server are set up correctly.
Alrighty yeah that worked great thanks for all the help