Updating PHP

Support for webhosts that use CentOS
Post Reply
crosstalk42
Posts: 17
Joined: 2011/05/31 15:25:40

Updating PHP

Post by crosstalk42 » 2011/05/31 17:00:22

Hi all,

I couldn´t find anything on updating from php 5.2 to 5.3... will this outdated guide work for the update?
http://wiki.centos.org/HowTos/PHP_5.1_To_5.2

Thanks!

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Updating PHP

Post by pschaff » 2011/05/31 21:56:20

Welcome to the CentOS fora. Reading [url=https://www.centos.org/modules/newbb/viewforum.php?forum=47]FAQ & Readme First[/url] is recommended for new users.

Short answer no. This is quite a complicated question and I haven't got time to explain too much at the moment. Try a forum search on [url=https://www.centos.org/search.php?query=php53&mid=30&action=showall&andor=AND]php53[/url] for gory details and decide if the CentOS php53 packages or those from 3rd party repos such as IUS better meet your needs.

crosstalk42
Posts: 17
Joined: 2011/05/31 15:25:40

Re: Updating PHP

Post by crosstalk42 » 2011/06/01 16:12:41

Thank you for the welcome.

Could I simply uninstall the packages I have now for PHP 2.5 and run

[code]yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml[/code]

Would yum handle installing the latest version or is it more difficult than this?
Would removing all PHP 2.5 packages and installing only 2.6 packages affect my current server setup?

Thank you.
[Duplicate post deleted by moderator.]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Updating PHP

Post by pschaff » 2011/06/01 17:20:56

[quote]
crosstalk42 wrote:
...
Could I simply uninstall the packages I have now for PHP 2.5 and run
...[/quote]
Not quite that easy.

You can remove the 5.2 packages but what yum does depends on what repositories you have configured and what priorities you have set if using the yum-priorities plugin. Also be careful to note what dependencies are removed and replace them with compatible versions, preferably from the same repo.

Without changes to the core repo configuration the command you showed would give you the default php-5.1.6-27.el5_5.3 packages.

To use the corresponding php53-5.3.3-1.el5_6.1 packages from the CentOS 5.6 repo you could do[code]yum install php53 php53-mysql php53-common php53-gd php53-mbstring php53-mcrypt php53-devel php53-xml[/code]

To use [url=http://wiki.iuscommunity.org/Doc/ClientUsageGuide]IUS[/url] you must first configure that repo. To install php53u-5.3.6-1.ius.el5 packages you would use[code]yum --disablerepo \* --enablerepo ius install php53u php53u-mysql php53u-common php53u-gd php53u-mbstring php53u-mcrypt php53u-devel php53u-xml[/code]

The only repo that supplies php packages that directly replace core packages by the same name is Atomic, but I would not recommend them due to their overly-aggressive approach to forcing wholesale replacement of core package with theirs with their default repo config, and overwriting of user changes to the repo config.

[quote]
Would removing all PHP 2.5 packages and installing only 2.6 packages affect my current server setup?[/quote]
There is no php-2.5 nor 2.6 and I have no idea what might break. I do know anecdotally that 5.2 to 5.3 is a bigger change than 5.1 to 5.2 so breakage is not unlikely.

crosstalk42
Posts: 17
Joined: 2011/05/31 15:25:40

Re: Updating PHP

Post by crosstalk42 » 2011/06/01 17:37:34

Hi pschaff,

I couldn't find a way to edit my post... don't know what I was thinking when I was talking about PHP 2.5 and 2.6... I meant "PHP 5.2 and 5.3".

Can you show me how to edit my posts, or edit them for me to fix that? I don't want this thread to be documented incorrectly in case anyone in the future could make use of it.

Thanks.

crosstalk42
Posts: 17
Joined: 2011/05/31 15:25:40

Re: Updating PHP

Post by crosstalk42 » 2011/06/01 17:42:14

I did a search on IUS... it seems to be what I'm looking for in terms of updating Centos packages easily...

The command you listed below regarding IUS... will this require me to remove PHP 5.2 or will it simply update it to PHP 5.3?
[code]yum --disablerepo \* --enablerepo ius install php53u php53u-mysql php53u-common php53u-gd php53u-mbstring php53u-mcrypt php53u-devel php53u-xml[/code]

You have been a great help thus far, thank you very much.

-Crosstalk42

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Updating PHP

Post by pschaff » 2011/06/01 17:49:10

I don't know without trying it but I suspect you will need to remove the older php 5.2 packages first. It won't hurt to try the command and see what results, but I expect it will give some serious complaints from yum. I'd do[code]yum remove php\*[/code]and carefully note what gets removed so you can reinstall.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Updating PHP

Post by pschaff » 2011/06/01 17:54:55

[quote]
crosstalk42 wrote:
Hi pschaff,

I couldn't find a way to edit my post...[/quote]
The edit time for a user is about one hour. After that only a moderator can edit.

I think it would be more trouble than it's worth to go back and fix both your posts and mine at this point. The astute reader will note the corrections, and those sufficiently clueless to fail to notice are going to have bigger problems anyway. :-)

crosstalk42
Posts: 17
Joined: 2011/05/31 15:25:40

Re: Updating PHP

Post by crosstalk42 » 2011/06/10 16:13:16

Hi pschaff,

I'm not going to the update anytime soon. If I have a question, I'll post back. Thanks so much!

Post Reply

Return to “CentOS 5 - Webhosting Support”