This is a quick note to help people build, install and test apache2 and php. This should also help others that are building DSO modules for Apache2.

1) Build apache2
fink install apache2


2) Fix the build environment. The apache project is working to fix these problems, if they have not already in a newer version of apache2.

a)
Link built libs to names libtool can find. You will see something like:
-
ld: can't locate file for: -laprutil
make: *** [libs/libphp4.bundle] Error 1
### execution of failed, exit code 2
-
--
cd /sw/lib/apache2
ln -s libaprutil-0.la libaprutil.la
ln -s libaprutil-0.a libaprutil.a
ln -s libapr-0.a libapr.a
ln -s libapr-0.la libapr.la


b)
Make these changes to your apr-config and apu-config files. Just remove src paths and correct include, library paths and library names. examples below. Use can just copy and replace with snips below. This will work for all that have fink install to /sw.

These utilities return the wrong path and libraries information, thus causing projects using them to fail when linking with error like:
-
can't find library: /sw/src/root_package-x.x.x-2/sw/lib/libaprutil.la
-
--
vi /sw/bin/apr-config
# APR script designed to allow easy command line access to APR configuration
# parameters.

APR_MAJOR_VERSION="0"
APR_DOTTED_VERSION="0.9.2"

prefix="/sw/share/apache2"
exec_prefix="/sw/share/apache2"
bindir="/sw/bin"
libdir="/sw/lib/apache2"
datadir="/sw/share/apache2"
installbuilddir="/sw/share/apache2/build"
includedir="/sw/include/apache2"

CC="gcc"
CPP="gcc -E"
SHELL="/bin/sh"
CPPFLAGS=" -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp"
CFLAGS="-g -O2"
LDFLAGS=""
LIBS="-lm "
EXTRA_INCLUDES=""
SHLIBPATH_VAR="REPLACE_WITH_YOUR_SHLIBPATH_VAR"
APR_SOURCE_DIR="/sw/lib/apache2"
APR_SO_EXT="lo"
APR_LIB_TARGET="-rpath \$(libdir) \$\$objects"
APR_LIBNAME="apr-${APR_MAJOR_VERSION}"


vi /sw/bin/apu-config
# APR-util script designed to allow easy command line access to APR-util
# configuration parameters.

APRUTIL_MAJOR_VERSION="0"
APRUTIL_DOTTED_VERSION="0.9.2"

prefix="/sw/share/apache2"
exec_prefix="/sw/share/apache2"
bindir="/sw/bin"
libdir="/sw/lib/apache2"
includedir="/sw/include/apache2"

LIBS="-lgdbm -ldb -lexpat -liconv"
INCLUDES="-I/sw/include -I/sw/include/apache2"
LDFLAGS="-L/sw/lib -L/sw/lib/apache2"

APRUTIL_LIBNAME="libaprutil-${APRUTIL_MAJOR_VERSION}.la"

APU_SOURCE_DIR="/sw/lib/apache2"
APU_BUILD_DIR=""
APR_XML_EXPAT_OLD=""

3) Build and install php-apxs2-ssl
To build this package you will have to install several packages that are not yet in the unstabe brach. You can download them from the fink package submission tracker. Install them to your local repository. Make sure to edit your fink.conf to include the local tree.

4) Update your httpd.conf to load the apache module. Add the following 2 lines to your httpd.conf file.
--
/sw/etc/apache2/httpd.conf
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule php4_module /sw/share/apache2/libphp4.so
AddType application/x-httpd-php .php

5) Start apache
apachectl stop
apachectl start

6) checking install
a) create a php test file.
touch /sw/share/apache2/htdocs/phptest.php
vi /sw/share/apache2/htdocs/phptest.php
i phpinof(); esc :wq!

b) Open your browser and type:
http://localhost/phptest.php

P.S. For those building php-apxs1-ssl for apache. You must edit your httpd.conf and fix your LoadModule directive. PHP current installer uses the path to the source version of the libphp4.so. So you will have to change the path to the installed version. It will be the same as those above it in the list. You will need to do this each time you rebuild php.
I will patch this if not fixed in the near future. It has been reported to the php developers.

-
You must add an appropriate LoadModule line to httpd.conf and enable
the handlers for the extensions you want to use (there are examples
for .php in httpd.conf).

An example for the LoadModule line:
LoadModule php4_module lib/apache/1.3/libphp4.so

An example for the AddModule line:
AddModule mod_php4.c
-

Enjoy, The power of PHP and Apache2:)

-Dustin



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to