3

Apologies in advance - I'm not a good Linux user by any stretch of the imagination.

I have a CentOS 5.7 dedicated server on which I host a few websites.

I currently have php 5.2.10 installed, but I'd like to update to 5.3.9.

I tried to update manually, and php -v displays 5.3.9. However, when I phpinfo(), it displays 5.2.10.

First problem

I followed these instructions for updating PHP manually:

  • Logged in as root
  • wget the latest PHP installation
  • tar zxvf php-.....gz
  • cd php-....
  • ./configure
  • make
  • apachectl stop
  • make install
  • apachectl start

I also tried restarting httpd by /usr/sbin/httpd restart.

php -v shows the latest version of PHP but phpinfo() on a php page shows the old version.

Any idea what the problem there might be?

Second Problem

If I try to yum update php, it says this:

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

  • epel: mir01.syntis.net

  • rpmforge: ftp-stud.fht-esslingen.de

Excluding Packages in global exclude list

Finished

Setting up Update Process

No Match for argument: php

No package php available.

No Packages marked for Update

I've tried yum clean all and adding rpmforge repositories - same outcome!

So, secondly, does anyone have any idea why I can't update php from yum? I'd like to be able to do that in future so that I can quickly and easily keep php and mySQL up to date.

Thanks in advance,

1
  • What are the outputs of grep exclude /etc/yum.conf and yum search php? As for the different versions, it sounds like you also need to update httpd's PHP module.
    – Chris Down
    Feb 1, 2012 at 18:25

3 Answers 3

2

If a repository that contains it is enabled, but this still happens, it is most likely excluded in /etc/yum.conf. Removing it should solve the issue.

1
  • Agreed PHP 5.3.9 is not available in the CentOS 5.7 unless you downloaded from other repo's.
    – wojox
    Feb 1, 2012 at 20:40
1

Compiling from source is the best way because it's always the latest source. When I compile php for my box it give me always a wrong name. I need to fix it manually for apache: ln -sf /usr/lib/apache2/libphp5.so /usr/lib/apache2/mod_php5.so. But it can depends on your configuration. Did you run make test after make? It should show you some more information.

-2

Have you tried yum update ? this will update all packages that are installed.

1
  • It seemed to update an awful lot... but not php!
    – turbonerd
    Feb 1, 2012 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .