LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 09-16-2007, 03:52 PM   #1
Bartoldo
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Rep: Reputation: 0
Apache2 doesn't parse php4 files (RHEL 4)


Hi,

I'm running a LAMB in my RHLE 4 box with Apache 2.0.52-19, php 4.3.9 but php doesn't load php files. What I get instead is:

You have chosen to open

php file

which is a: application/x-httpd-php.

The httpd.conf file has these:

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

Include conf.d/*.conf

the last line should make apache to look for the php.conf file which is in the directory conf.d:

LoadModule php4_module modules/libphp4.so

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

DirectoryIndex index.php

this is the content of php.conf
libphp4.so is also in the modules directory.

So, everything seems to be all right but it doesn't work. php is up and running, I can use it from the command line just typing php but Apache doesn't load php files.

Thanks for your help
 
Old 09-18-2007, 06:13 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
One thing you might try is dumping the cache in the browser (you may have a corpse laying around in cache).

Although I have a different distribution, so some directory names may be different, my httpd.conf file has, in this order:
Code:
DirectoryIndex index.html index.php
Include /etc/httpd/mod_php.conf
and mod_php.conf contains this:
Code:
#
# mod_php - PHP Hypertext Preprocessor module
#

# Load the PHP module:
LoadModule php5_module lib/httpd/modules/libphp5.so

# Tell Apache to feed all *.php files through PHP.  If you'd like to
# parse PHP embedded in files with different extensions, comment out
# this line and see the example below.
AddType application/x-httpd-php .php

# Tell Apache to feed all *.php, *.html, and *.htm files through
# the PHP module.  Add or subtract extensions here as desired.  Please
# note that running pages through PHP for no reason can be both slow
# and insecure, so be sure to know what you're doing.  It's a convenient
# shortcut, but probably isn't suitible for high-traffic sites if you
# write any of your pages in straight HTML.
#AddType application/x-httpd-php .php .html .htm

# This will display PHP files in colored syntax form.  Use with caution.
#AddType application/x-httpd-php-source .phps
These happen to be for PHP 5, but I don't remember PHP 4 being any different. Note that the include is the specific file name and the order of .phps and .php.

Hope this helps some.
 
Old 09-19-2007, 01:52 PM   #3
Bartoldo
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,

thanks Tronayne. I was so fed up that I uninstalled and reinstalled RHEL again. After that the only issue was group permissions, I had to include the apache user into the user's private group typing (as su):

# usermod -G user apache

to check that everything is OK type

# cat /etc/groups | grep user:

# groups apache

I did so many changes in the apache's conf file that probably it was too messy to work properly or perhaps I changed accidentally other parameters.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHLE 4 Apache2 doesn't load php4 files Bartoldo Red Hat 3 09-15-2007 08:17 AM
apache2 won't parse php irvken Linux - Software 9 11-26-2006 06:19 AM
phpbb, apache2, php4 Odins_Son Linux - Software 2 12-23-2004 02:24 AM
apache2 + php4 atheist Linux - Software 6 10-25-2004 03:12 PM
php4 with apache2? the debian way, how? Tisch Debian 4 08-19-2004 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration