1

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

5
  • 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, 2011 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, 2011 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, 2011 at 22:34
  • I reread the rules, I don't know what else I am missing.
    – John R
    Nov 19, 2011 at 22:38
  • Perhaps you should ask on Meta Server Fault
    – MDMarra
    Nov 19, 2011 at 23:00

2 Answers 2

7

Try

yum install mod_php 

This will load the php module for Apache.

3
  • 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, 2011 at 1:37
  • The conf file should automatically be placed in the /etc/httpd/conf.d/ directory
    – ckliborn
    Nov 20, 2011 at 5:18
  • This installs php-5.4.16 on RHEL 7, it doesn't install PHP7.
    – vy32
    Apr 7, 2017 at 18:39
1

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.

1
  • Yes. I am running Apache2.
    – John R
    Nov 19, 2011 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .