Solved

php3 files display their source code on centos

Posted on 2008-06-25
2
426 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP AJAX Wordpress 9 21
comma true 6 34
I've got an interview this morning and I want to sound intelligent... 4 54
Cookie not unsetting 7 20
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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 dynamically set the form action using jQuery.

803 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