Subject: Problem making PHP5 under NetBSD =?utf-8?b?Mi4xLjBfU1RBQkxF?=
To: None <netbsd-users@netbsd.org>
From: Gerardo Alvarez <zakwer3d@gmail.com>
List: netbsd-users
Date: 12/15/2005 00:28:20
I have installed Apache 2 and MySQL using pkgsrc, rather easily.
However PHP5 is being very hard, complaining about missing headers, etc.
Looking the error up in the user groups I have ended up adding several lines to
lang/php5/Makefile.php.
After that I got stuck with a new error after "checking for mysql_error in
-lmysqlclient... no".
I have tried to solve it with these instructions (
http://terra.di.fct.unl.pt/docs/php/install.unix.php.htm - PHP-5.0.0b1 and MySQL
on SuSE), adapted for /usr/pkg, like this:

cd /usr/pkg/lib/mysql
ln -s /usr/pkg/include/mysql include
ln -s /usr/pkg/lib/mysql lib
& checking that makefile.php has CONFIGURE_ARGS+=--with-mysql=/usr/pkg/lib/mysql

But make keeps stopping in the same spot.
- I have tried make install, make clean, make distclean many times.
- I even redownloaded and cvs-updated the whole pkgsrc just in case there was
something wrong with it (that´s why the path is /KK/pkgsrc/... instead of
/usr/pkgsrc/...).
- I can´t use pkg_add because there is no package for NetBSD 2.1.0

My little brain is rapidly approaching its last resources.
Help would be welcome.
Am I missing something?
What am I doing wrong?
Thanks


These are my additions to Makefile.php:

####################################################################

CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-server/work/mysql-5.0.16/libmysqld
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-server/work/mysql-5.0.16/sql
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-server/work/mysql-5.0.16/include
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-server/work/mysql-5.0.16
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-client/work/mysql-5.0.16
CONFIGURE_ARGS+=        --with-mysql=/usr/pkg/lib/mysql
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-client/work/mysql-5.0.16/libmysql_r
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-client/work/mysql-5.0.16/libmysql/.l
ibs
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-client/work/mysql-5.0.16/libmysql
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-server/work/.buildlink/lib/mysql
CONFIGURE_ARGS+=       
--with-mysql=/usr/pkgsrc/databases/mysql5-server/work/.buildlink
CONFIGURE_ARGS+=        --with-mysqli=/usr/pkg/bin

CONFIGURE_ARGS+=       
--with-zlib-dir=/usr/pkgsrc/archivers/php-zlib/work/php-5.0.5/ext/zlib
CONFIGURE_ARGS+=       
--with-zlib-dir=/usr/pkgsrc/lang/php5/work/php-5.1.1/ext/zlib
CONFIGURE_ARGS+=       
--with-zlib-dir=/usr/pkgsrc/databases/mysql5-server/work/mysql-5.0.16
CONFIGURE_ARGS+=       
--with-zlib-dir=/usr/pkgsrc/databases/mysql5-client/work/mysql-5.0.16

CONFIGURE_ARGS+=        --with-apxs2=/usr/pkg/sbin/apxs



This is the edited output from "make install", I am just leaving the parts that
seem more informative to me:

####################################################################

=> Attempting to fetch php-5.1.1.tar.bz2 from http://www.php.net/distributions/.
(...)
===> Required installed package libxml2>=2.6.15: libxml2-2.6.17 found
(...)
===> Configuring for php-5.1.1nb2
creating cache ./config.cache
checking for Cygwin environment... no
(...)
checking for ZLIB support... no
checking if the location of ZLIB install directory is defined...
/usr/pkgsrc/databases/mysql5-client/w
ork/mysql-5.0.16
checking for gzgets in -lz... yes
(...)
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
*** Error code 1

Stop.
make: stopped in /KK/pkgsrc/lang/php5
===> 
===> There was an error during the ``configure'' phase.
===> Please investigate the following for more information:
===>      * config.log
===>      * /KK/pkgsrc/lang/php5/work/.work.log
===> 
*** Error code 1

Stop.
make: stopped in /KK/pkgsrc/lang/php5

####################################################################

And this is the information at the end of the logs:

IN pkgsrc/lang/php5/work/php-5.1.1/config.log:

####################################################################
configure:57987: checking for MySQL support
configure:58033: checking for specified location of the MySQL UNIX socket
configure:58090: checking for MySQL UNIX socket location
configure:58276: checking for mysql_close in -lmysqlclient
configure:58295: cc -o conftest -O2 -I/usr/pkg/include -I/usr/include
-I/usr/pkg/include -I/usr/includ
e -I/usr/pkg/include
-R/usr/pkgsrc/databases/mysql5-server/work/.buildlink/lib/mysql -L/usr/pkgsrc/dat
abases/mysql5-server/work/.buildlink/lib/mysql -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
-L/usr/lib -Wl,-R/usr
/lib -L/usr/pkg/lib -R/usr/pkg/lib -L/usr/pkg/lib conftest.c -lmysqlclient  -lz
-lssl -lcrypto -lm  -l
xml2 -lz -lm 1>&5
ld: cannot find -lmysqlclient
configure: failed program was:
#line 58284 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:58516: checking for mysql_error in -lmysqlclient
configure:58535: cc -o conftest -O2 -I/usr/pkg/include -I/usr/include
-I/usr/pkg/include -I/usr/includ
e -I/usr/pkg/include
-R/usr/pkgsrc/databases/mysql5-server/work/.buildlink/lib/mysql -L/usr/pkgsrc/dat
abases/mysql5-server/work/.buildlink/lib/mysql -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
-L/usr/lib -Wl,-R/usr
/lib -L/usr/pkg/lib -R/usr/pkg/lib -L/usr/pkg/lib -R/usr -L/usr conftest.c
-lmysqlclient  -lz -lz -lss
l -lcrypto -lm  -lxml2 -lz -lm 1>&5
ld: cannot find -lmysqlclient
configure: failed program was:
#line 58524 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }

####################################################################

In /KK/pkgsrc/lang/php5/work/.work.log

####################################################################

    (logic) pop:  -I/KK/pkgsrc/lang/php5/work/.buildlink/include
    (logic) to:   -I/KK/pkgsrc/lang/php5/work/.buildlink/include [cached]
    (logic) push: -I/KK/pkgsrc/lang/php5/work/.buildlink/include
    (logic) pop:  -L/KK/pkgsrc/lang/php5/work/.buildlink/lib
    (logic) to:   -L/KK/pkgsrc/lang/php5/work/.buildlink/lib [cached]
    (logic) push: -L/KK/pkgsrc/lang/php5/work/.buildlink/lib
    (cmd-sink) pop: -o
    (cmd-sink) pop: conftest
    (cmd-sink) pop: -O2
    (cmd-sink) pop: -I/KK/pkgsrc/lang/php5/work/.buildlink/include
    (cmd-sink) pop: 
    (cmd-sink) pop: -I/KK/pkgsrc/lang/php5/work/.buildlink/include
    (cmd-sink) pop: 
    (cmd-sink) pop: -I/KK/pkgsrc/lang/php5/work/.buildlink/include
    (cmd-sink) pop: 
    (cmd-sink) pop: 
    (cmd-sink) pop: -L/KK/pkgsrc/lang/php5/work/.buildlink/lib
    (cmd-sink) pop: -Wl,-R/usr/pkg/lib
    (cmd-sink) pop: 
    (cmd-sink) pop: 
    (cmd-sink) pop: -L/KK/pkgsrc/lang/php5/work/.buildlink/lib
    (cmd-sink) pop: -R/usr/pkg/lib
    (cmd-sink) pop: -L/KK/pkgsrc/lang/php5/work/.buildlink/lib
    (cmd-sink) pop: 
    (cmd-sink) pop: 
    (cmd-sink) pop: conftest.c
    (cmd-sink) pop: -lmysqlclient
    (cmd-sink) pop: -lz
    (cmd-sink) pop: -lssl
    (cmd-sink) pop: -lcrypto
    (cmd-sink) pop: -lm
    (cmd-sink) pop: -lxml2
    (cmd-sink) pop: -lz
    (cmd-sink) pop: -lm
    (cmd-sink) pop: -I/KK/pkgsrc/lang/php5/work/.buildlink/include
    (cmd-sink) pop: -L/KK/pkgsrc/lang/php5/work/.buildlink/lib
<.> /KK/pkgsrc/lang/php5/work/.gcc/bin/gcc -o conftest -O2
-I/KK/pkgsrc/lang/php5/work/.buildlink/incl
ude -L/KK/pkgsrc/lang/php5/work/.buildlink/lib -Wl,-R/usr/pkg/lib -R/usr/pkg/lib
conftest.c -lmysqlclient -lz -lssl -lcrypto -lm -lxml2 -lz -lm

####################################################################