Subject: Re: php3-mysql problems
To: Dean Huxley <dean@huxley.org>
From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
List: netbsd-help
Date: 04/29/2000 23:42:23
Dean Huxley writes:
> I've just installed php3-mysql-3.0.16 and I'm having problems using mysql
> functions.
> 
> With a simple test file I get:
> 
> Fatal error: Call to unsupported or undefined function mysql_connect()
> 
> I doesn't seem to be finding the mysql.so file:
> -r--r--r--  1 root  wheel  26737 Apr 29 15:40 /usr/pkg/lib/php3/mysql.so
> 
> I've stopped and restarted apache, ran several different tests, and
> the last access time on mysql.so never changes.
> 
> Is there some configuration file I need to change?

You need to make sure you added it to /usr/pkg/etc/php3.ini:
...
extension_dir=/usr/pkg/lib/php3
extension=mysql.so
...

Note that php3-mysql is build without linking libm, which is required.
You need to patch the Makefile like this:
--- Makefile.orig       Tue Feb 15 07:44:14 2000
+++ Makefile    Sat Apr 29 23:33:56 2000
@@ -12,7 +12,7 @@
 do-build:
        cd ${WRKSRC}/functions && \
                ${COMPILE.c} -I.. -I. -I${LOCALBASE}/include/mysql -fPIC -DPIC -
DCOMPILE_DL mysql.c && \
-               ld -Bshareable -o mysql.so mysql.o -L${LOCALBASE}/lib/mysql -R${
LOCALBASE}/lib/mysql -lmysqlclient
+               ld -Bshareable -o mysql.so mysql.o -L${LOCALBASE}/lib/mysql -R${
LOCALBASE}/lib/mysql -lmysqlclient -lm

 do-install:
        ${INSTALL_DATA} ${WRKSRC}/functions/mysql.so ${PREFIX}/lib/php3/

This may not be relevant for 1.4.2, but it appears to be necessary for
ELF and/or -current systems.

-Andrew
-- 
-----------------------------------------------------------------
Andrew Gillham                            | NetBSD ist Affengeil.
gillham@whirlpool.com                     | Nachts ist es kaelter
I speak for myself, not for my employer.  | als draussen.