Take the 2-minute tour ×

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 stackoverflow.com 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 unix.stackexchange.com or serverfault –  Elias Van Ootegem Sep 13 '12 at 16:07

4 Answers 4

up vote 3 down vote accepted

What about official way?

yum update php php-* -y



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

Many of us use the remi repository to keep current with PHP and MySQL. It will currently give you PHP 5.3 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

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 http://www.atomicorp.com/wiki/index.php/PHP

share|improve this answer

Your Answer


