oci_connect() works only from command line

Problem solved! Thanks to these (Setting the Oracle Environment section) instructions and ken_yap's answer to this thread.

To put variables in Apache's Environment section you just have to add them in /etc/sysconfig/apache2 file: LD_LIBRARY_PATH=/path/to/oracle/lib.


Another solution ( that do not need root access ) is to add this lines in the php page:

putenv("ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1");
putenv("LD_LIBRARY_PATH=/opt/app/oracle/product/11.2.0/db_1/lib:/lib:/usr/lib");

Regards