• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

php3 files display their source code on centos

does anybody know how i can change this?
0
markmchugh
Asked:
markmchugh
1 Solution
 
James CookCommented:
If the source code is showing, it usually indicates that PHP is not running.
Also check the extension of the web page e.g. index.php rather than index.html
0
 
snruddaCommented:
Check you webserver config and look for .php or .php4 or .php5 extension there. Say in Apache httpd.conf this should looks like this:

  AddType application/x-httpd-php .php

So you just copy that line and change extension to whatever you like, say

  AddType application/x-httpd-php .php3

You may also see line(s) like that:

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

It sets PHP to colour-rich output source code of files with .phps extension. Frankly in most cases you don't need that at all, so yo3 can just comment out that line(s) (simple put hash sign (#) in front of it).

Now to save the config and restart your webserver.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now