Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just ran yum install php in the command prompt. Everything went fine ('complete!') as per the dialogue. I then uploaded a file that does not use short tags and is named with the proper extension (i.e., the name is test.php).

<?php print "hello world"; ?>

When I navigate my browser to test.php it just prints each of the characters shown above; i.e., PHP is not interpreting it.

What might be the problem? Also, if there is a configuration file that needs to be updated, please tell me what directory path I am likely to find that file.

Edit: Apache2 & Red Hat Enterprise 5.5

share|improve this question
Saying that you run "Redhat" is worthless. What version? Perhaps you should read How to Ask and then re-write your question. – MDMarra Nov 19 '11 at 19:05
Yes, I am new to setting up servers. I acknowledeged, I should have put the edditions in. I tried to give a detailed description from the perspective of a newb dealing with a command line. I thought this was a place for learning (at any level). Why the '-1'? – John R Nov 19 '11 at 22:30
The -1 wasn't from me, but I'd guess that it's from the complete lack of detail. – MDMarra Nov 19 '11 at 22:34
I reread the rules, I don't know what else I am missing. – John R Nov 19 '11 at 22:38
Perhaps you should ask on Meta Server Fault – MDMarra Nov 19 '11 at 23:00
up vote 7 down vote accepted


yum install mod_php 

This will load the php module for Apache.

share|improve this answer
This will install the php module for Apache, but you should still check your config files and make sure it will be loaded. – Scott Pack Nov 20 '11 at 1:37
The conf file should automatically be placed in the /etc/httpd/conf.d/ directory – ckliborn Nov 20 '11 at 5:18

Check apache (I presume you are running apache) is actually loading the php module, and has the correct handlers setup for .php files.

Sounds like a web server issue rather than a php issue.

share|improve this answer
Yes. I am running Apache2. – John R Nov 19 '11 at 16:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.