Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2004 14:24:38 +0100
From:      "Olaf Greve" <o.greve@axis.nl>
To:        "'Cristi Tauber'" <cristi.tauber@sbhost.ro>
Cc:        'FreeBSD Question' <freebsd-questions@freebsd.org>
Subject:   RE: php4-cli or mod_php4
Message-ID:  <00f001c4db96$efd138a0$1e01a8c0@sjees>
In-Reply-To: <41B096FF.6030706@daleco.biz>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

> >  i want to install apache+php+mysql. If i install mod_php i cannot
> >install php4-extension (mysql, etc ...). If i try to install php4-cli
> >and extensions apache doesn't know how to handle .php files  . What's
the
> >they to go to make apache work with mysql and php ? fBSD is 5.3.

Well, up until fBSD 5.2.1 when installing PHP4 and Apache 1.3 using
sysinstall, matters would all automatically be swell. Then, the other
day I installed fBSD 5.3 on a client's machine, then I did the same
trick by installing Apache 1.3, PHP4 + extensions and I tested the
combination. A simple 'hello world' script worked a charm, but then I
put the actual application on the machine, and all sorts of things would
not work!

It seems that as of fBSD 5.3, the version that is installed when using
sysinstall has a lot less compile options enabled than it used to do
previously, one of which being the MySQL support. Here's what I did to
solve the issue:
1) Install Apache 1.3, PHP4 (MOD + CLI), PHP4 extensions.
2) Make sure this combination can successfully execute a simple 'hello
world' example.
3) Figure out PHP's compilation options (this can be done e.g. using
PHPinfo).
4) If possible, compare these options to those of a system on which
everything works as it should (I was lucky enough to be able to do so,
but perhaps you do not have access to such a system). No write down the
compilation options that you're missing in your installation (e.g.
something like --enable-mysql, etc.).
5) Go to the proper ports directory, which I think (if memory serves me
right here) is something like /ports/lang/php4. Check the Makefile
structure, in the beginning of that file you can see PHP's compilation
options.
6) Add the missing options to this file. Perform a 'make remove' (to
first uninstall PHP4), then perform a 'make all' followed by a 'make
install' (I think these were the steps).
7) Restart apache using 'apachectl restart' and check the compilation
options again. If you did this process correctly, PHP should work fine
now.

Note: enabling PHP4 from the Apache httpd.conf file is not that
difficult. If your 'hello world' example fails to run, and you can't
figure out which configuration options to set in Apache's httpd.conf
file, and/or in PHP's php.ini file, please let me know. I've done this
several times now, so I can probably help you out with it...

Cheerz!
Olafo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00f001c4db96$efd138a0$1e01a8c0>