Solved

php3 files display their source code on centos

Posted on 2008-06-25
2
406 Views
Last Modified: 2011-10-03
does anybody know how i can change this?
0
Comment
Question by:markmchugh
2 Comments
 
LVL 3

Expert Comment

by:James Cook
Comment Utility
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
 
LVL 4

Accepted Solution

by:
snrudda earned 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now