Click to See Complete Forum and Search --> : Apache serves PHP Script as plain text


Ozzy
11-10-2002, 04:24 AM
My Apache web server serves PHP as plain text. I followed the install instructions in the PHP manual to no avail.

What do I add/ uncomment in the httpd.conf??

Thank you

Ozzy
11-10-2002, 04:25 AM
I am using RedHat 7.

Choozo
11-10-2002, 07:13 AM
In your httpd.conf file, under the <IfModule mod_mime.c> section, make sure you have

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

Ozzy
11-10-2002, 10:33 AM
That made the APACHE server the PHP CODE as HTML code, what do I do to get it to EXECUTE the PHP??

Thanks

Choozo
11-10-2002, 10:41 AM
Well, the whole idea of PHP is that your webserver should return pages as HTML after the PHP engine has parsed your PHP scripts.

If you have followed all the instructions, this should work fine?

Have a look over at www.e-gineer.com for some more instructions on setting up Apache/PHP/MySQL, etc.

goon12
11-10-2002, 04:03 PM
Did you copy your "php.ini-dist" file to /usr/local/lib/php.ini. After you do that, make sure you restart apache..

/usr/local/apache/bin/apachectl restart

Stuka
11-12-2002, 03:29 PM
Just as an additional bit, the PHP module needs to be loaded by Apache - the PHP distribution has plenty of good docs on doing this.