Apache and PHP installation on Debian

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Apache and PHP installation on Debian

Post 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?
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Apache and PHP installation on Debian

Post 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)?
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Apache and PHP installation on Debian

Post 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?
Only Human
Ushma

Re:Apache and PHP installation on Debian

Post 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"
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Apache and PHP installation on Debian

Post by Neo »

I finally used the prefork model and have everything working now.
Only Human
Post Reply