1

Note: I have an application that requires 5.2, yet my server presently runs 5.1.6.

I'm very new to server-administration, but I was thinking the task of updating PHP to 5.2+ should be relatively simple. Online I found that the following was allegedly sufficient to do this:

yum update php 

But when I run this, the following is output:

[root@ip-XXX-XXX-XXX-XXX /]# php -v PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies [root@ip-XXX-XXX-XXX-XXX /]# yum update php Loaded plugins: fastestmirror Determining fastest mirrors * addons: p3plmirror02.prod.phx3.secureserver.net * base: p3plmirror02.prod.phx3.secureserver.net * extras: p3plmirror02.prod.phx3.secureserver.net * turbopanel-base: p3plmirror02.prod.phx3.secureserver.net * turbopanel-centos5: p3plmirror02.prod.phx3.secureserver.net * update: p3plmirror02.prod.phx3.secureserver.net addons | 951 B 00:00 addons/primary | 201 B 00:00 base | 2.1 kB 00:00 base/primary_db | 1.6 MB 00:00 extras | 1.1 kB 00:00 extras/primary | 107 kB 00:00 extras 325/325 turbopanel-base | 951 B 00:00 turbopanel-base/primary | 72 kB 00:00 turbopanel-base 494/494 turbopanel-centos5 | 951 B 00:00 turbopanel-centos5/primary | 2.1 kB 00:00 turbopanel-centos5 8/8 update | 1.9 kB 00:00 update/primary_db | 463 kB 00:00 Setting up Update Process No Packages marked for Update [root@ip-XXX-XXX-XXX-XXX /]# php -v PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technolog [root@ip-XXX-XXX-XXX-XXX /]# No Packages marked for Update [root@ip-XXX-XXX-XXX-XXX /]# php -v bash: No: command not found [root@ip-XXX-XXX-XXX-XXX /]# [root@ip-XXX-XXX-XXX-XXX /]# php -v bash: [root@ip-XXX-XXX-XXX-XXX: command not found [root@ip-XXX-XXX-XXX-XXX /]# PHP 5.1.6 (cli) (built: Jan 13 2010 17:13:05) bash: syntax error near unexpected token `(' [root@ip-XXX-XXX-XXX-XXX /]# Copyright (c) 1997-2006 The PHP Group bash: syntax error near unexpected token `c' [root@ip-XXX-XXX-XXX-XXX /]# Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies bash: syntax error near unexpected token `(' [root@ip-XXX-XXX-XXX-XXX /]#

My PHP version is 5.1.6 before, and after running the command. Am I being too naive here with this update process? Is there a more verbose route that is necessary for me to take?

2 Answers 2

3

You're attempting to upgrade the package provided by the distribution. Often, distributions will not change the version but backport security fixes, which is done to maintain a more stable environment. As major revision changes can affect the operation of software, they typically will only be done between major revisions of the distribution.

If you want to run the latest PHP, you'll likely have to create your own package, locate a third party package, or compile from source making your own build standard.

Based on the output provided, it's reasonable to assume you're running the latest version of PHP available for the current distribution you're running.

It looks like the CentOS wiki has a walkthrough for updating to 5.2 using the development repo.

0
0

No you aren't doing anything wrong, it's just that 5.1.6 is the latest package available - at least in the CentOS repositories. You can do a yum info php to get more detailed information including what version number is in the repositories.

2
  • How might I install a version of PHP later than the one currently listed in yum info php? I have an application that requires 5.2. Commented May 24, 2010 at 16:14
  • @Aristotle: See Warner's answer Commented May 24, 2010 at 16:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.