Discussion:
[PHP-INSTALL] PHP Startup: Invalid library (maybe not a PHP library) 'oci8.so' in Unknown on line 0
Alejandro Vargas
2009-07-10 13:48:52 UTC
Permalink
Hello, I need to access an oracle database from php. The server is
running php 5.2.5, then I downloaded the source package used to
compile this version.

I downloaded also oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
and oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm

After some time tewaking with ./configure of php, I managed to compile
with ./configure --with-oci8=shared,instantclient

I want to compile oci8 as shared library so I can continue using the
same binaries and only add a .so to the extensions directory, but I
has a problem now. When starting, php reports this error:

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)
'oci8.so' in Unknown on line 0

Checking the mailing lists I read this problema may be due to an
incorrect version of the extension, but it has been compiled with the
same sources version that phpinfo() reports (5.2.5).

I will appreciate any ideas of how to check now.
pmenier
2009-07-10 14:22:55 UTC
Permalink
Post by Alejandro Vargas
Hello, I need to access an oracle database from php. The server is
running php 5.2.5, then I downloaded the source package used to
compile this version.
I downloaded also oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
and oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
After some time tewaking with ./configure of php, I managed to compile
with ./configure --with-oci8=shared,instantclient
I want to compile oci8 as shared library so I can continue using the
same binaries and only add a .so to the extensions directory, but I
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)
'oci8.so' in Unknown on line 0
Checking the mailing lists I read this problema may be due to an
incorrect version of the extension, but it has been compiled with the
same sources version that phpinfo() reports (5.2.5).
I will appreciate any ideas of how to check now.
Hello

I have done this job succesfully with php-5.2.{6,7,8,9,10} on debian-lenny.

***@server:/# rpm -iv oracle-instantclient-basic-10.2.0.3-1.i386.rpm
***@server:/# rpm -iv oracle-instantclient-devel-10.2.0.3-1.i386.rpm

When i compile php, i run .configure -with-other-options
--with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.3/client/lib

Then you must add this:

***@server:/etc/ld.so.conf.d# cat oracle.conf
/usr/lib/oracle/10.2.0.3/client/lib

Then run: ldconfig -v

Note you will have ton install libaio, too.

HTH
Patrick

ps: i run php in cgi mode.
Christopher Jones
2009-07-10 18:30:10 UTC
Permalink
Post by pmenier
Post by Alejandro Vargas
Hello, I need to access an oracle database from php. The server is
running php 5.2.5, then I downloaded the source package used to
compile this version.
I downloaded also oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
and oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
After some time tewaking with ./configure of php, I managed to compile
with ./configure --with-oci8=shared,instantclient
I want to compile oci8 as shared library so I can continue using the
same binaries and only add a .so to the extensions directory, but I
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)
'oci8.so' in Unknown on line 0
Checking the mailing lists I read this problema may be due to an
incorrect version of the extension, but it has been compiled with the
same sources version that phpinfo() reports (5.2.5).
I will appreciate any ideas of how to check now.
Hello
I have done this job succesfully with php-5.2.{6,7,8,9,10} on debian-lenny.
When i compile php, i run .configure -with-other-options
--with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.3/client/lib
/usr/lib/oracle/10.2.0.3/client/lib
Then run: ldconfig -v
Note you will have ton install libaio, too.
HTH
Patrick
ps: i run php in cgi mode.
Changing ld.so.conf.d might cause all Oracle applications on the
machine to use the same Instant Client. This is generally OK, but if
you don't want it, you could instead set LD_LIBRARY_PATH before
starting Apache. See
http://www.oracle.com/technology/pub/notes/technote_php_instant.html
Also see "Setting Oracle Environment Variables for Apache" on p106 of
http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf

Installing OCI8 as a shared library makes it easy to upgrade. With
PHP 5.2, I strongly recommend using the latest OCI8 1.3 from
http://pecl.php.net/package/oci8

Regarding installation of OCI8 as a shared library, there shouldn't be
any need to tweak configure scripts. This blog post documents using
the PECL installer:
http://blogs.oracle.com/opal/2009/03/pecl_install_prompts_explained.html

Chris
--
Email: ***@oracle.com
Twitter: http://twitter.com/ghrd
Loading...