|
Posted by Bart The Bear on 09/20/06 01:29
On Tue, 19 Sep 2006 01:15:07 -0400, sims123 wrote:
>
> Can some one tell me how can I install a new version of oci8 when I
> already have php and oci8 installed.
>
> I also wanted to how to find which oci version do I have.
>
> -Simmi
You should do the following:
1) Download & unpack the software
2) Go to the directory where you unpacked the software and run
the following, in that order:
phpize
./configure
make
As "root":
make install
After that, you will have to update your php.ini. If you created it from
the php.ini-dist there are comments how to do that. Typically, parameters
you need to adjust would look like this:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922"
extension=oci8.so
Also, for OCI8 you must not have OCI8 already linked into the PHP module.
There is also a standard recommendation to have the following option
enabled when linking PHP: --enable-sigchild
Here is almost complete example:
$ tar zxvf oci8-1.2.2.tgz
package.xml
oci8-1.2.2/CREDITS
oci8-1.2.2/README
oci8-1.2.2/config.m4
oci8-1.2.2/config.w32
oci8-1.2.2/oci8.dsp
oci8-1.2.2/oci8.c
oci8-1.2.2/oci8_interface.c
oci8-1.2.2/oci8_lob.c
oci8-1.2.2/oci8_statement.c
oci8-1.2.2/oci8_collection.c
oci8-1.2.2/php_oci8.h
........
oci8-1.2.2/tests/skipif.inc
oci8-1.2.2/tests/statement_cache.phpt
oci8-1.2.2/tests/statement_type_old.phpt
oci8-1.2.2/tests/statement_type.phpt
oci8-1.2.2/tests/uncommitted.phpt
$
$ cd oci8-1.2.2
$ phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
$
$ ./configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
......
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
configure: creating ./config.status
config.status: creating config.h
$ make
/bin/sh /tmp/oci8-1.2.2/libtool --mode=compile gcc -I. -I/tmp/oci8-1.2.2 -DPHP_ATOM_INC -I/tmp/oci8-1.2.2/include -I/tmp/oci8-1.2.2/main -I/tmp/oci8-1.2.2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/oracle/product/10g/rdbms/public -I/oracle/product/10g/rdbms/demo -I/oracle/product/10g/plsql/public -DHAVE_CONFIG_H -g -O2 -c /tmp/oci8-1.2.2/oci8.c -o oci8.lo
mkdir .libs
gcc -I. -I/tmp/oci8-1.2.2 -DPHP_ATOM_INC -I/tmp/oci8-1.2.2/include -I/tmp/oci8-1.2.2/main -I/tmp/oci8-1.2.2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/oracle/product/10g/rdbms/public -I/oracle/product/10g/rdbms/demo -I/oracle/product/10g/plsql/public -DHAVE_CONFIG_H -g -O2 -c /tmp/oci8-1.2.2/oci8.c -fPIC -DPIC -o .libs/oci8.o
.....
Libraries have been installed in:
/tmp/oci8-1.2.2/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
After that, you do make install like this:
$ su - root
Password:
[root@medo ~]# service httpd stop
Stopping httpd: [ OK ]
[root@medo ~]# cd /tmp/oci8-1.2.2
[root@medo oci8-1.2.2]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20050922/
[root@medo oci8-1.2.2]# service httpd start
Starting httpd: [ OK ]
[root@medo oci8-1.2.2]#
[root@medo oci8-1.2.2]# ls -l /usr/local/lib/php/extensions/no-debug-non-zts-20050922/
total 288
-rwxr-xr-x 1 root root 287297 Sep 19 21:23 oci8.so
[root@medo oci8-1.2.2]#
Of course, phpinfo will now return the requested information:
oci8
OCI8 Support enabled
Version 1.2.1
Revision $Revision: 1.269.2.16.2.21 $
Active Persistent Connections 0
Active Connections 0
Oracle Version no value
Compile-time ORACLE_HOME no value
Libraries Used no value
Temporary Lob support enabled
Collections support enabled
Directive Local Value Master Value
oci8.default_prefetch 10 10
oci8.max_persistent -1 -1
oci8.old_oci_close_semantics 0 0
oci8.persistent_timeout -1 -1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20
Observe that "Version" string in phpinfo output still shows the version
1.2.1 despite the fact that I downloaded and installed version 1.2.2.
It's just a little innocuous bug, nothing else.
Navigation:
[Reply to this message]
|