LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2002, 02:04 PM   #1
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Rep: Reputation: 15
PHP and httpd.conf


Having problems installing php with apache.

I've found the couple of lines on the net which go like this:

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

But when I add them to httpd.conf and restart apache, I get the following error (in Bash)

Syntax error on line 24 of /etc/httpd/conf/httpd.conf:
Invalid command 'AddType', perhaps mis-spelled or defined by a module not included in the server configuration

What is the correct config part in httpd.conf?
 
Old 05-17-2002, 02:49 PM   #2
sewer_monkey
Member
 
Registered: May 2002
Location: Toronto, ON, Canada
Distribution: Ubuntu, Debian, RedHat/CentOS
Posts: 624

Rep: Reputation: 31
Did you stick these lines inside some other directive? For example:
Code:
<Directory /whatever/>
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps 
</Directory>
 
Old 05-17-2002, 04:35 PM   #3
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Original Poster
Rep: Reputation: 15
Hmmmm, no I didn't and I can see why that would cause the error I was getting. What do you suggest goes in the <directory /whatever/> bit - is that the path to PHP?

Thanks
 
Old 05-17-2002, 05:07 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 12,395

Rep: Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297
Do you have mod_mime loaded into apache? Look for the appropriate LoadModule and AddModule line in your httpd.conf file. You can see what modules are statically built into apache by typing httpd -l.

--jeremy
 
Old 05-17-2002, 05:31 PM   #5
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Original Poster
Rep: Reputation: 15
This is what's in the file for mime_module.

LoadModule mime_module modules/mod_mime.so
 
Old 05-17-2002, 05:45 PM   #6
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 12,395

Rep: Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297
From the modules directory I am guessing you are using apache 2.x? If so try:
Quote:
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
--jeremy
 
Old 05-17-2002, 06:28 PM   #7
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Original Poster
Rep: Reputation: 15
Nope, I'm using 1.3.23

Thanks
 
Old 05-18-2002, 10:40 AM   #8
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 12,395

Rep: Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297Reputation: 3297
hmm...ok. Do you have a AddModule mod_mime.c line to go along with that LoadModule?

--jeremy
 
Old 05-18-2002, 04:23 PM   #9
adcripps
Member
 
Registered: Mar 2002
Location: South UK
Distribution: Mandrake 8.2
Posts: 103

Original Poster
Rep: Reputation: 15
Just searched through it now and that string isn't found.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
modifying httpd.conf for php Cikotic Linux - Software 6 08-22-2004 12:38 PM
Red Hat 9 server can't write PHP script, problem in httpd.conf file? x_menno_x Linux - Newbie 27 06-29-2004 04:44 PM
PHP - What to add to Apache httpd.conf file? maktos Linux - Software 9 04-17-2004 08:18 PM
saving changes to apache2/conf/httpd.conf file Zaius Linux - Newbie 6 01-09-2004 11:45 PM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration