LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   PHP and httpd.conf (https://www.linuxquestions.org/questions/linux-newbie-8/php-and-httpd-conf-21221/)

adcripps 05-17-2002 02:04 PM

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?

sewer_monkey 05-17-2002 02:49 PM

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>


adcripps 05-17-2002 04:35 PM

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

jeremy 05-17-2002 05:07 PM

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

adcripps 05-17-2002 05:31 PM

This is what's in the file for mime_module.

LoadModule mime_module modules/mod_mime.so

jeremy 05-17-2002 05:45 PM

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

adcripps 05-17-2002 06:28 PM

Nope, I'm using 1.3.23

Thanks

jeremy 05-18-2002 10:40 AM

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

--jeremy

adcripps 05-18-2002 04:23 PM

Just searched through it now and that string isn't found.


All times are GMT -5. The time now is 01:14 PM.