Re: Oracle, Linux and PHP == seg fault
| From: | Deirdre Saoirse | Date: | Fri, 04 Aug 2000 19:58:06 +0000 |
| Subject: | Re: Oracle, Linux and PHP == seg fault | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1792@lists.php.net to get a copy of this message | ||
On Thu, 3 Aug 2000 php-db@zimage.com wrote:
> I can't seem to get PHP to play with Oracle. I try to run httpd
> and I get a seg fault. The only thing that worked was the Oracle 8.0.5
> client libs. I tried with the 8.1.5 libs, the 8.1.5.1 libs, the 8.1.6.1
> libs... NOTHING. I tried with Redhat 6.1 and 6.2... NOTHING. I tried
> with different versions of Apache... NOTHING. What the heck is going on?
> Is there something horribly wrong with Oracle's libraries? What's the
> secret???
The current Oracle is 8.1.6; I have gotten it working with that. What
you're seeing, in part, is a problem between threaded and non-threaded
stuff not playing nice.
I spent the whole week wrestling with this one and, as Rasmus really
helped, here's my successful (yay!) solution:
0) set your Oracle variables; the library dir should also be set in
/etc/ld.so.conf and ldconfig run. For me, these vars are:
export ORACLE_HOME=/apps/db/oracle
export ORACLE_SID=ENGR01
export LD_LIBRARY_PATH=/apps/db/oracle/lib
export ORACLE_BASE=/apps/db/oracle
1) download a PHP4 snapshot from snaps.php.net
2) download the appropriate apache version (e.g. 1.3.12)
3) unpack them in a directory (such as /usr/local/src)
4) cd to the apache directory and run configure:
./configure --prefix=/usr/local/src/apache_1.3.12
5) make sure you're including the threading libraries:
export LIBS=libpthread
(you can also hack the Makefiles after configuring if you prefer)
6) cd to the php directory and run configure:
./configure --with-oci8 --prefix=/usr --with-apache=../apache_1.3.12
--with-config-file-path=/etc/httpd --enable-safe-mode
--with-exec-dir=/usr/bin --with-system-regex --disable-debug --with-zlib
--with-gdbm --with-db2 --enable-debugger --enable-magic-quotes
--enable-track-vars --enable-sysvsem --enable-sysvshm --with-xml
--with-ftp
make
make install
7) cd back to the apache directory
./configure --with-layout=RedHat
--activate-module=src/modules/php4/libphp4.a
make
ldd src/httpd
(make sure that libpthread is in there, among other lines you should see:
libclntsh.so.8.0 => /apps/db/oracle/lib/libclntsh.so.8.0
(0x4003e000)
libwtc8.so => /home/oracle/sw/oracle/lib/libwtc8.so (0x407a1000)
libpthread.so.0 => /lib/libpthread.so.0 (0x407a3000)
make install
Use the /etc/httpd/conf/httpd.conf.default and copy it to httpd.conf. Make
sure and activate the php doc types by uncommenting the appropriate
AddType lines.
--
_Deirdre * http://www.sfknit.org * http://www.deirdre.net
"We can always count on the British. Except for the Revolutionary War
they've been perfect." -- Mel Brooks, on the first Concorde flight since
the Paris crash.