Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

php3 files display their source code on centos

Posted on 2008-06-25
2
Medium Priority
?
452 Views
Last Modified: 2011-10-03
does anybody know how i can change this?
0
Comment
Question by:markmchugh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …
Suggested Courses

609 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