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 am running a Redhat on a webserver. The current version of php on the server is 5.1.6. I want to upgrade it to 5.3.8 so I downloaded php and compiled it and replaced the older php binary with the newer one. I then restarted the httpd daemon. When I type php -v on the command line it gives me 5.3.8 but when I look at php on the browser using <?phpinfo();?> I get 5.1.6. How can I resolve this?


share|improve this question

migrated from Sep 13 '12 at 16:09

This question came from our site for professional and enthusiast programmers.

You're probably using Apache together with mod_php5, which is outdated. – galymzhan Sep 13 '12 at 16:04
So I need to upgrade mod_php5 separately? – Farhat Sep 13 '12 at 16:06
Can you output the contents of your PATH variable? – Sam Grondahl Sep 13 '12 at 16:06
You might want to post this on or serverfault – Elias Van Ootegem Sep 13 '12 at 16:07
up vote 3 down vote accepted

What about official way?

yum update php php-* -y

Never ever mess up system with downloading tar/gz while official package exists.

Also look here :

Be sure to restart apache after upgrade :

service httpd restart
share|improve this answer

You need to download and compile the PHP module, not the PHP command line binary. So you will also need to recompile (a part of) Apache httpd. Which also mean recompiling (a part of) SSL if you use HTTPS.

But doesn't Red Hat come with a package upgrade capability? Why do you need to recompile everything?

share|improve this answer
You don;t need to download/compile apache's module.YUM package php also provides mod_php. – user106666 Sep 13 '12 at 16:29

You can use the atomic repo in order to updated your PHP, used it many times and it works like a charm, here is a link

share|improve this answer

Many of us use the remi repository to keep current with PHP and MySQL. It will currently give you PHP 5.4 and MySQL 5.5 on EL5 and EL6. All you need to do is install the remi-release RPM and then yum upgrade.

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.