LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache2 not processing PHP4 pages on Debian Sarge (https://www.linuxquestions.org/questions/linux-software-2/apache2-not-processing-php4-pages-on-debian-sarge-283585/)

blue penguin 01-28-2005 11:44 PM

Apache2 not processing PHP4 pages on Debian Sarge
 
Hi all,

I recently installed the .deb packages of Apache2 and php4 which I've been told should work out of the box but for some reason not on my machine.

I have read the apache2 and php4 README files and Googled. I have found that other people have posted similar threads and have been told to check that
Code:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

are enabled in their httpd.conf file
they are not enabled in my htppd.conf file because it seems to be superceeded by the apache2.conf file. My httpd.conf says
Code:

# This is here for backwards compatability reasons and to support
#  installing 3rd party modules directly via apxs2, rather than
#  through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

AddType application/x-httpd-php .php and
AddType application/x-httpd-php-source .phps are commented out by default in my apache2.conf file because they are in the php4.conf file which gets included.

apache2.conf
Code:

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

$ cat php4.conf shows
Code:

<IfModule mod_php4.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>

and $ cat php4.load shows

Code:

LoadModule php4_module /usr/lib/apache2/modules/libphp4.so
the path is correct.

I did try uncommenting AddType application/x-httpd-php .php and
AddType application/x-httpd-php-source .phps in my apache2.conf anyway (and restarted apache2) but it didn't have an effect, I also put them in my httpd.conf (and restarted) also with no effect. I tried including php4.load and php4.conf in the httpd.conf but when I restarted that time it said
Code:

Restarting web server: Apache2
[Sat Jan 29 17:27:34 2005] [warn] module php4_module is already loaded, skipping
.

I have just seen my apache2-doc in /etc/apache2/conf.d/ it only mentions handling html files. Could this be the root of my problem?
apache2-doc
Code:

AliasMatch ^/apache2-default/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/usr/share/doc/apache2-doc/manual/$1"
AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/usr/share/doc/apache2-doc/manual/$1"
<Directory "/usr/share/doc/apache2-doc/manual/">
    Options Indexes
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from  127.0.0.0/255.0.0.0 ::1/128

    <Files *.html>
        SetHandler type-map
    </Files>

    SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1
    RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2
</Directory>

please explain things clearly as I'm still a :newbie:

Thak you for your attention :)

j-ray 01-29-2005 06:45 AM

probably you are editing the wrong file (im guessing only). the httpd.conf file belongs to apache_1.3.x very likely. place the

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php
in the config file that belongs to apache2.x.x
then restart the server

i dont know debian but that should work anyway

good luck

j.

blue penguin 01-29-2005 07:57 AM

I tried that and it unfortunately didn't work.

Thanks for replying anyway. Danke schön! :)

havelino 02-03-2005 09:54 AM

Use apt-get install libapache2-mod-php4

In my case this was the solution.

Verylinux 02-05-2005 08:31 AM

I think below article will be helpful:

RedHat's httpd-2.0.46-44 Reference Manual

Your can read it from my website: verylinux.com!

Regards

hazza96 02-09-2005 03:24 AM

Did you get this working? I run Ubuntu which is Debian based and am having exactly the same problem.

blue penguin 02-09-2005 04:25 AM

Sorry, I had to put my attempts at getting php running aside for a while to study for an exam :study:. A missing libapache2-mod-php4 is not my problem as it is installed I will now read this httpd reference manual and I hope that helps, I have glanced at it already and it seemed a bit over my head but hopefully I can understand it when I take the time to read it properly

havelino 02-09-2005 07:48 AM

I'm using apache2 & php4 for snort and Acid and they are working fine.

What i did,

apt-get install Apache2

php4

libapache-mod-php4

(i rebooted here because i had to go home with my laptop but don't think it matters)

and it worked.

I left out a lot other things that are needed to make snort and acid working but don't matter if this here above doesn't work I can give you the whole installation procedure. Only i'm still working on the details so maybe you've to wait a few days.

UberPuppy 08-24-2006 02:56 PM

handlers!
 
Hey,

I've had the same problem with nearly every server install on any ubuntu machine I've ever craeted. In the end the solution was to add the php _handlers_ (not just the AddType). Basically, this is a line that start with AddHandler..blahblah..php4.

Except, that I can't remember how I did it and am now looking for it. I think this simply got lost somewhere when the Modules were moved into included files rather than an embedded list, and it's been a problem ever since.

When I find it, I'll post again (perhaps I should have waited,,, hmmmmm) :)

UPDATE: look at http://tranchant.plus.com/notes/multiviews


All times are GMT -5. The time now is 12:07 PM.