PHP & Apache2 on OpenBSD
| From: | r dot php at btinternet dot com | Date: | Thu, 05 Feb 2004 21:33:12 +0000 |
| Subject: | PHP & Apache2 on OpenBSD | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-12722@lists.php.net to get a copy of this message | ||
Hello people,
Problem ! (aren't they all ?)
I'm trying to get PHP working with Apache 2 on OpenBSD. Apache 2 is not
supported in the OpenBSD ports so I figured I'd just build it from the
standard source distribution. I've done this on Linux and it's never caused
me a problem.
I have used exactly the same configuration on the OpenBSD build that I have
used on Linux.
I build Apache with...
> ./configure --prefix=/usr/local/apache2 --enable-ssl
--with-ssl=/usr/src/openssl/openssl-0.9.7 -enable-mods-shared="libphp4"
-enable-modules="access dir mime mime_magic log_config alias negotiation setenvif"
> make
> make install
...and I build PHP with...
> ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php
--with-apxs2=/usr/local/apache2/bin/apxs --enable-track-vars
--enable-magic-quotes --enable-debugger --with-mysql=/usr/lib
--enable-inline-optimization --without-pear
> make
> make install
There's no hint of a problem with either build and sure enough, Apache runs
fine on its own and serves pages with no problems.
But if I try and load the libphp4.so module with...
LoadModule php4_module modules/libphp4.so
...I get nothing !
I try and start apache and it just returns. No tasks, no error log, no core
dump, nothing. Absolutely no indication why it fails. And before you ask,
yes, all the file permissions are fine - I get error logs when I don't load
libphp4.so and I've made sure the core dump directory is writable etc etc.
I can load other modules with no problems; I re-jigged the apache config to
build 'access' as a module and load this with...
LoadModule access_module modules/mod_access.so
...and it works fine.
If I try and syntax check the config file with the PHP 'LoadModule' line in
(with /usr/local/apache2/bin/httpd -t), it doesn't even return a 'Syntax Ok'
message. If I comment out the PHP 'LoadModule' line, I do. If I start apache
with the PHP Loadmodule line commented out and then comment the line back in
and try and stop apache, it ignores me and carries on running ! It looks like
just having the LoadModule php4... line in the config file is killing the
apache startup/shutdown stone dead. But I know this doesn't make sense, so it
MUST be something to do with the PHP module itself... mustn't it ?
The apache config file I'm using is one I've used for ages on Linux and I'm
sure it's absolutely fine. If I strip it down to the bare minimum, PHP will
still fail to load. Here's such a config file that I've tried...
# Apache 2 config
ErrorLog logs/error_log
LogLevel debug
ServerRoot "/usr/local/apache2"
User httpd
Group httpd
PidFile logs/httpd.pid
# This next line works fine
LoadModule access_module modules/mod_access.so
# This next line is causing me grief !
LoadModule php4_module modules/libphp4.so
Listen 192.168.0.2:80
# End
One thing I have noticed is that the libphp4.so built on OpenBSD is
significantly smaller than on Linux (3M rather than 4.9M). I've tried to
build the PHP module from the OpenBSD ports tree and it builds ok (though
it's only just over 1M), but I get exactly the same result when trying to
start Apache.
I've looked at the OpenBSD resource limits and these shouldn't be causing a
problem.
If anyone has any idea what's going on (getting some error output would be a
start) I'd be very grateful.
Alternatively, if anyone has an alternative approach, or a known working
solution, I'm willing to give it a go.
regards,
Rich.