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 have a centos server. I have installed apache 2.2.17 from a .tar.gz file. I've also install php 5.3 from the ius repository. That worked fine and apache is functioning and so is php 5.3. However, when i put a phpinfo.php file in the directory that apache should be serving files from, it doesn't work. I can only seem to get php to work if i use yum install httpd which installs an older vesion of apache. Any ideas? Thanks.

share|improve this question
up vote 4 down vote accepted

Assuming that you're installing a PHP module for Apache, you need to be using the same version of Apache it was built against. It's a bad idea to try to mix-and-match source packages and binary packages like this. Either find a reputable repository and install everything from there, or build everything from source, but trying to mix it up like this will usually lead to this sort of problem.

share|improve this answer

Open /etc/httpd/conf/httpd.conf using any editor like nano or vi, the go to section <IfModule mime_module> and make sure that you have this two lines:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

If you don't have them the add them and restart you apache like so:

/sbin/service httpd restart
share|improve this answer

As larsks mentioned, you're mixing and matching versions. That's why grabbing the version from Redhat's repository's worked. Do you really need the functionality provided in any of the newer versions of Apache? If not, go with the version provided by RedHat. It will have all the same security patches you'll find in the latest official Apache version. And it will obviously work with your version of PHP. And it will be far easier to maintain than the tarfile dump you're using now.

share|improve this answer

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.