Page 1 of 1

Apache and PHP installation on Debian

Posted: Sat Sep 03, 2005 12:19 am
by Neo
I've never used Debian before and now have access to a Debian system that has Apache2 already installed.
I need to get PHP working there with Apache2 and have tried a lot but have not been able to get it working.
I tried this out

Code: Select all

dpkg -i libapache2-mod-php4_4.3.10-16_i386.deb
and got this in response

Code: Select all

Selecting previously deselected package libapache2-mod-php4.
(Reading database ... 22741 files and directories currently installed.)
Unpacking libapache2-mod-php4 (from libapache2-mod-php4_4.3.10-16_i386.deb) ...
dpkg: dependency problems prevent configuration of libapache2-mod-php4:
 libapache2-mod-php4 depends on apache2-mpm-prefork (>> 2.0.52); however:
  Package apache2-mpm-prefork is not installed.
dpkg: error processing libapache2-mod-php4 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libapache2-mod-php4
I then tried installing the 'apache2-mpm-prefork' package but that told me that the 'apache2-mpm-worker' package was ;aready installed and quit.
Is it not possible to have the prefork package with 'libapache2-mod-php4'
Or can something else be done?

Re:Apache and PHP installation on Debian

Posted: Sat Sep 03, 2005 1:04 am
by Neo
Ok after some research I guess that my actual question should be
"How do I install apache2-mpm-worker and the php4 module together on Debian?"
Is this possible or not? or do I have to use the 'prefork' model only? if so then how do i un-install the mpm-worker (man this is supposed to be much faster that is why I wanted it)?

Re:Apache and PHP installation on Debian

Posted: Sat Sep 03, 2005 7:42 am
by Neo
I've further come to realize that only the php-cgi version is thread safe enough for the MPM-worker model in Apache2.
So I managed to get the CGI version installed in Debian.
Now I want to know how to configure apache2 to use this cgi for parsing php files?
Any ideas?

Re:Apache and PHP installation on Debian

Posted: Sat Sep 03, 2005 9:57 am
by Ushma
IIRC, it's something like this:

Code: Select all

ScriptAlias /php/ "/path/to/PHP/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi-executable"

Re:Apache and PHP installation on Debian

Posted: Sun Sep 04, 2005 12:39 am
by Neo
I finally used the prefork model and have everything working now.