Super User is a question and answer site for computer enthusiasts and power users. 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 use Fedora 17 on my laptop, and I am trying to do some web development work on it. I have installed Apache, MySQL and PHP on the laptop (following this guide when it comes to what software to install: I can load web pages, but I am unable to load PHP pages properly. All that happens is that the actual code of the of the script is displayed in browser.

I've checked to see if mod_php is installed, and it is. I thought that maybe PHP was turned off globally, but I don't think it is. I must stress actually, that although the guide that I put the link to on this post does talk about turning PHP globally off, I haven't done this. I have just installed the software. But anyway, I have tried to look for the php.conf files in the httpd/conf.d directory, but nothing is there. I've also created a file which includes <?php phpinfo(); ?>, but even this is displayed as plain text and not working.

I'm quite confused about why it's not working. I remember having a similar issue before, but that was back in 2009, and I haven't experienced this problem since.

Can anyone help?

Many thanks in advance!

I've checked the httpd.conf, and looked at the LoadModules section. There is no mention of loading PHP in there. I've added the line and then httpd fails to start. I then removed that line I added, and checked the modules directory. Again there is no mention of PHP there either.

I went to install mod_php with yum again (like I've done with all of the packages), and it comes back saying that the package is already installed.

share|improve this question
That's the problem with guides, you don't get a deep understanding of how it works by them. – Tom Wijsman Aug 11 '12 at 18:04
True but it also gives you a good starting point with a subject, which I feel is a good thing. – mickburkejnr Aug 11 '12 at 18:13
up vote 3 down vote accepted

Let enable the module with the a2enmod command. This tool will help identify if there's any issues with you installed libphp5 module

shell~> sudo a2enmod php5
shell~> sudo apachectl -M | grep php5
Syntax OK
 php5_module (shared)

shell~> sudo /etc/init.d/httpd restart

More info about enabling/disabling apach2 modules here

share|improve this answer

In /etc/httpd/conf or /etc/apache2/conf depending on distro.

edit your httpd.conf and make sure these are included right below existing modules.

LoadModule php5_module   modules/
AddType application/x-httpd-php .php
share|improve this answer

You must log in to answer this question.

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