Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 I get 5.1.6. How can I resolve this?


share|improve this question
up vote 4 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 : http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-centos-5.3-lamp

Be sure to restart apache after upgrade :

service httpd restart
share|improve this answer
'Never ever mess up system with downloading tar/gz while official package exists.' - second that! – gertvdijk Sep 13 '12 at 20:47
this won't actually upgrade him to PHP 5.3, his RHEL server will remain on the PHP 5.1 since Red Hat backports patches, rather than doing major version upgrades. – mmckinst Sep 23 '12 at 3:13

It sounds like you're on a RHEL 5 server since you have PHP 5.1.6. To solve your problem of wanting PHP 5.3, Red Hat offers official packages for php53 on RHEL 5 that you can use. You might also want to look at the IUS repo which provides better PHP and MySQL version coverage.

As for why php -v and your browser are showing different things. It would depend on your PHP setup but it could be a lot of things, maybe you just need to restart Apache, maybe you need to restart php-fpm, maybe you need to put the Apache module in the right location, etc. Whatever the problem is, mixing RPMs and stuff you've compiled from source is not a good idea and I'd look in to using one of the RPM methods above.

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.