FreeBSD 5.4 and PHP Configure

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
I am having problems getting the customapache build php process to work. More specifically though it would appear to be the ./configure command

here is the configure
Code:
#!/bin/sh
./configure \
        --with-apxs \
        --with-curl \
        --with-curl-dir=/usr/local/lib \
        --with-gd \
        --with-gd-dir=/usr/local \
        --with-gettext \
        --with-jpeg-dir=/usr/local/lib \
        --with-freetype-dir=/usr/local/lib \
        --with-kerberos \
        --with-mcrypt \
        --with-mhash \
        --with-mysql=/usr/local/mysql \
        --with-pear \
        --with-png-dir=/usr/local/lib \
        --with-xml \
        --with-dom \
        --with-zlib \
        --with-zlib-dir=/usr/local/lib \
        --with-zip \
        --with-openssl \
        --enable-bcmath \
        --enable-calendar \
        --enable-ftp \
        --enable-magic-quotes \
        --enable-sockets \
        --enable-track-vars \
        --enable-mbstring \
        --enable-memory-limit

note I have tried both with the default configure.php and this on

config.log

Server Uname: FreeBSD <hostname> 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #0: Fri May 13 18:09:49 BST 2005 <kernel name> amd64
 
I updated via cvsup from 5.3 last night, made a new world and kernel, and then did

build clean
build update
build all

this morning and everything looks ok.

wheretobuild# uname -a
FreeBSD wheretobuild.leadasp.com 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #0: Mon May 16 17:26:10 CDT 2005 [email protected]:/usr/obj/usr/src/sys/FIREWALL i386

Is this a new installation or did you do an update?
 
brand new installation of DirectAdmin

your system is an i386 though, I have suspicions that it might be the amd64 side of things
 
Ooops, didn't catch that in the uname. Never worked with a 64 so I am not help at all. Sorry.
 
here is your problem

configure:58951: checking for mysql_close in -lmysqlclient
configure:58970: gcc -o conftest -g -O2 -R/usr/local/mysql/lib -L/usr/local/mysql/lib -R/usr/local/lib -L/usr/local/lib conftest.c -lmysqlclient -lmhash -lmcrypt -lltdl -lintl -lfreetype -lpng -lz -ljpeg -lz -lcurl -lz -lssl -lcrypto -lm -lgssapi -lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lcom_err -lcurl -lssl -lcrypto -lz -lxml2 -lz -liconv -lm 1>&5
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient

your configure.php is wrong, I have posted about this 3 or 4 times now on the forums.

--with-mysql=/usr/local/mysql \

the correct syntax for that would be --with-mysql=/usr/local \.
 
changed the configure.php line to --with-mysql=/usr/local and I got this

configure: error: Cannot find MySQL header files under /usr/local

also a note that when you delete configure.php and then refetch it it has --with-mysql \ and doesnt include a path, however when you run ./build php it then sets that line to --with-mysql=/usr/local/mysql \
though as mentioned changing to this /usr/local
 
Last edited:
Ok I will adress 1 thing at a time.

The reason I believe /usr/local is failing and I was expecting it to fail is because you are using the default directadmin mysql setup and that is setup in a non standard location. In this case you can probably just use '--with-mysql' which will use the built in php mysql libs.

Directadmin I am aware they set '--with-mysql=/usr/local/mysql \' but this is wrong, me and others I believe have told them this is incorrect but it hasnt been changed so this only servers to confuse people more.

Run this on your server 'locate libmysqlclient.a'

See what it comes up with.
 
--with-mysql for php is not recommended when also using mod_perl

locate didnt turn up anything so I tried find

# find / -name "libmysqlclient.a" -print
/usr/local/mysql-4.1.11-unknown-freebsd5.1-i386/lib/libmysqlclient.a

could it be that mysql is desgined for FreeBSD 5.1 and an i386 system and not 5.4 on amd64?
 
The problem is as I already stated you can see from the result of your find that mysql is in a non standard location, so you have 3 options.

1 - Install mysql from ports so it goes to proper location this will make future maintenance much easier and allow the proper php configure switch to work. This is what I would do.

2 - Use the built in php mysql functions, but you dont want to do this, and this will also cause problems since you are using mysql 4.1 not 4.0.

3 - Change the php configure switch path so it works with that non standard location, this is trial and error but I think what might work is '--with-mysql=/usr/local/mysql-4.1.11-unknown-freebsd5.1-i386 \'

Really directadmin should be fixing this mess, more and more people are just going to have problems and get confused because of the bad default setup.
 
Back
Top