Solved

php3 files display their source code on centos

Posted on 2008-06-25
2
415 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
ID: 21863363
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
ID: 21864489
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

948 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

18 Experts available now in Live!

Get 1:1 Help Now