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?


2 Answers 2


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
  • 'Never ever mess up system with downloading tar/gz while official package exists.' - second that!
    – gertvdijk
    Sep 13, 2012 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. Sep 23, 2012 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.