# HOW TO: Install PHP 5.2 through yum

**URL:** <https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592>\
**Category:** Hacks / Tools / Tips / Tricks\
**Created:** [April 8, 2010, 7:33am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592 "2010-04-08T07:33:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![IWorx-Jon](https://forums.interworx.com/letter_avatar_proxy/v4/letter/i/f14d63/32.png) [@IWorx-Jon](https://forums.interworx.com/u/IWorx-Jon)\
**Post date:** [April 8, 2010, 7:33am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/1 "2010-04-08T07:33:24Z")

</div>

As many of you know, the version of PHP that ships with CentOS 5 is very outdated. One question we are constantly asked is “How can I install PHP 5.2 on my InterWorx server?”. Wouldn’t it be a lot easier if you could just add them to yum? Of course it is, so here’s how to do it. 😉

Please note these RPMs are Unsupported. We will try our best to make sure that nothing breaks, but using these RPMs is at your own risk.

1.) Create a file called iworx-unsupported.repo in /etc/yum.repos.d/

```auto
 [root@host ~]$ emacs /etc/yum.repos.d/iworx-unsupported.repo 

```

2.) Enter the following, replacing cos5x with rhe5x if using RHEL 5 or rhe4x if using RHEL 4, centOS 4 users may be out of luck.

```auto
[iworx-unsupported]
name=IWorx Unsupported
baseurl=http://updates.interworx.com/iworx/RPMS/unsupported/php5/cos5x/$basearch/
gpgcheck=0

```

3.) Now run yum update.

```auto
[root@host ~]$ yum update

```

4.) You should be greeted with the following text.

```auto
==================================================================================================
 Package Arch Version Repository Size
==================================================================================================
Updating:
 php i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 3.7 M
 php-cli i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 2.7 M
 php-common i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 505 k
 php-devel i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 567 k
 php-ldap i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 57 k
 php-mysql i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 258 k
 php-pdo i386 5.2.12-rhe5x.iworx.js.100 unsupported-php 157 k

Transaction Summary
==================================================================================================
Install 0 Package(s)         
Update 7 Package(s)         
Remove 0 Package(s)         

Total download size: 7.8 M
Is this ok [y/N]:

```

---

<div class="post-metadata">

**Author:** ![john2k](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/a698b9/32.png) [@john2k](https://forums.interworx.com/u/john2k)\
**Post date:** [April 9, 2010, 8:38am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/2 "2010-04-09T08:38:28Z")

</div>

Thanks for posting this. Perfect timing as I’m just getting started to upgrade my forums to vBulletin 4, which requires PHP 5.2+.

If by some chance upgrading to PHP 5.2 does cause problems with scripts or whatever, what would be the process to revert back to the previous default supported version of PHP? Or rather, how would we undo this change if necessary?

---

<div class="post-metadata">

**Author:** ![IWorx-Jon](https://forums.interworx.com/letter_avatar_proxy/v4/letter/i/f14d63/32.png) [@IWorx-Jon](https://forums.interworx.com/u/IWorx-Jon)\
**Post date:** [April 9, 2010, 9:45am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/3 "2010-04-09T09:45:47Z")

</div>

To revert the PHP update to the base version installed by CentOS, you just need to run the following command. Note: You may need to specify additional packages if you installed any other php extensions not listed here.

```auto
yum downgrade php php-cli php-common php-devel php-ldap php-mysql php-pdo

```

---

<div class="post-metadata">

**Author:** ![IWorx-Tim-Pgh](https://forums.interworx.com/user_avatar/forums.interworx.com/iworx-tim-pgh/32/10_2.png) [@IWorx-Tim-Pgh](https://forums.interworx.com/u/IWorx-Tim-Pgh)\
**Post date:** [April 12, 2010, 5:52am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/4 "2010-04-12T05:52:31Z")

</div>

AND - remove the new repo, cause otherwise the upgrade will just happen the next time someone runs “yum upgrade” 🙂

---

<div class="post-metadata">

**Author:** ![SoccerGuy3](https://forums.interworx.com/user_avatar/forums.interworx.com/soccerguy3/32/56_2.png) [@SoccerGuy3](https://forums.interworx.com/u/SoccerGuy3)\
**Post date:** [September 1, 2010, 3:24pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/5 "2010-09-01T15:24:19Z")

</div>

Tried these instructions today and it isn’t working. The one thing I see is this error:

```auto
--> Finished Dependency Resolution
5:php-pear-5.2.9-100.rhe5x.iworx.steadfast.i386 from installed has depsolving problems
  --> Missing Dependency: php = 5.2.9-100.rhe5x.iworx.steadfast is needed by package 5:php-pear-5.2.9-100.rhe5x.iworx.steadfast.i386 (installed)
Error: Missing Dependency: php = 5.2.9-100.rhe5x.iworx.steadfast is needed by package 5:php-pear-5.2.9-100.rhe5x.iworx.steadfast.i386 (installed)

```

Not sure what this is or how to fix it. Suggestions?

---

<div class="post-metadata">

**Author:** ![IWorx-Dan](https://forums.interworx.com/letter_avatar_proxy/v4/letter/i/d2c977/32.png) [@IWorx-Dan](https://forums.interworx.com/u/IWorx-Dan)\
**Post date:** [September 1, 2010, 3:49pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/6 "2010-09-01T15:49:21Z")

</div>

We would need more information to determine what is wrong. If you bought your license through us you can open a support ticket and we can take a look.

---

<div class="post-metadata">

**Author:** ![Justec](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Justec](https://forums.interworx.com/u/Justec)\
**Post date:** [January 27, 2011, 8:29am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/7 "2011-01-27T08:29:54Z")

</div>

I upgraded my CentOS 5.5 to PHP 5.2 using this method and worked well. Only hiccup I ran into was I got a warning in NodeWorx on the web server page:  
“Warning, mod\_php and mod\_suphp are both enabled, this is a security risk!”

I just restarted apache and then the warning was gone and everything seems fine running on suPHP.

---

<div class="post-metadata">

**Author:** ![Gimly](https://forums.interworx.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@Gimly](https://forums.interworx.com/u/Gimly)\
**Post date:** [February 10, 2011, 1:13pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/8 "2011-02-10T13:13:53Z")

</div>

I-ve seen an update in iworx repository for php 5.2.17. I made an YUM UPDATE, but I’ve dependencies error with php5.2.14 iworx :

> yum update  
> Excluding Packages from Les RPM de remi pour Enterprise Linux 5 - i386  
> Finished  
> Setting up Update Process  
> Resolving Dependencies  
> –\> Running transaction check  
> —\> Package php.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-cli.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> –\> Processing Dependency: php-common = 5.2.14-1.w5 for package: php-pspell  
> —\> Package php-common.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-devel.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-gd.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-imap.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-mbstring.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-mcrypt.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-mhash.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-mysql.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-odbc.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-pdo.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-soap.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> —\> Package php-xml.i386 0:5.2.17-rhe5x.iworx.js.suhosin.fpm.200 set to be updated  
> –\> Finished Dependency Resolution  
> php-pspell-5.2.14-1.w5.i386 from installed has depsolving problems  
> –\> Missing Dependency: php-common = 5.2.14-1.w5 is needed by package php-pspell-5.2.14-1.w5.i386 (installed)  
> Error: Missing Dependency: php-common = 5.2.14-1.w5 is needed by package php-pspell-5.2.14-1.w5.i386 (installed)  
> You could try using --skip-broken to work around the problem  
> You could try running: package-cleanup --problems  
> package-cleanup --dupes  
> rpm -Va --nofiles --nodigest  
> The program package-cleanup is found in the yum-utils package.

If you have an idea ?

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Mehmet\_Ali](https://forums.interworx.com/letter_avatar_proxy/v4/letter/m/bcef8e/32.png) [@Mehmet\_Ali](https://forums.interworx.com/u/Mehmet_Ali)\
**Post date:** [February 25, 2011, 6:56am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/9 "2011-02-25T06:56:33Z")

</div>

[QUOTE=Gimly;17909]I-ve seen an update in iworx repository for php 5.2.17. I made an YUM UPDATE, but I’ve dependencies error with php5.2.14 iworx :  
If you have an idea ?  
Thank you :)[/QUOTE]

You can use this command

yum update php php-cli php-common php-devel php-ldap php-mysql php-pdo

---

<div class="post-metadata">

**Author:** ![sysnop](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/cdc98d/32.png) [@sysnop](https://forums.interworx.com/u/sysnop)\
**Post date:** [June 14, 2011, 4:40am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/10 "2011-06-14T04:40:38Z")

</div>

> [@IWorx-Tim-Pgh;16988](#):
>
> AND - remove the new repo, cause otherwise the upgrade will just happen the next time someone runs “yum upgrade” 🙂

For folks who installed using the experimental repo, what is best practice for regular scheduled updates? Turn them off and continue updating with the experimental repo? If so, is there a way to schedule OS updates only?

Thanks.

---

<div class="post-metadata">

**Author:** ![IWorx-Dan](https://forums.interworx.com/letter_avatar_proxy/v4/letter/i/d2c977/32.png) [@IWorx-Dan](https://forums.interworx.com/u/IWorx-Dan)\
**Post date:** [June 16, 2011, 2:30pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/11 "2011-06-16T14:30:48Z")

</div>

[QUOTE=sysnop;18089]For folks who installed using the experimental repo, what is best practice for regular scheduled updates? Turn them off and continue updating with the experimental repo? If so, is there a way to schedule OS updates only?

Thanks.[/QUOTE]

What do you mean by “experimental repo” - the iworx unsupported repo? Or another 3rd party repo like atomic or remi?

---

<div class="post-metadata">

**Author:** ![sysnop](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/cdc98d/32.png) [@sysnop](https://forums.interworx.com/u/sysnop)\
**Post date:** [June 16, 2011, 5:39pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/12 "2011-06-16T17:39:30Z")

</div>

I mean the unsupported iworx repo. Thought I saw it referred to as “experimental” somewhere in the forums but I can see how the iworx team might not care for that reference.

---

<div class="post-metadata">

**Author:** ![IWorx-Dan](https://forums.interworx.com/letter_avatar_proxy/v4/letter/i/d2c977/32.png) [@IWorx-Dan](https://forums.interworx.com/u/IWorx-Dan)\
**Post date:** [June 16, 2011, 8:10pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/13 "2011-06-16T20:10:48Z")

</div>

Oh I guess it can be called experimental - you really shouldn’t have to worry about changing anything re: automatic updates unless you are using another 3rd party repository. Since CentOS/RHEL are running older versions of PHP they won’t ever overwrite the unsupported iworx PHP.

---

<div class="post-metadata">

**Author:** ![allwebnow](https://forums.interworx.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@allwebnow](https://forums.interworx.com/u/allwebnow)\
**Post date:** [September 9, 2011, 7:11am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/14 "2011-09-09T07:11:11Z")

</div>

I always thought hosting control panels were capable of controlling what version of php was run on the server via the interface. many popular php scripts (mainly the latest version of wordpress) are unable to be installed on 5.1 anymore. Considering php 5.3 has been out for 2 years now, Is interworx planning on providing php5.2 out of the box and supported in the near future?

---

<div class="post-metadata">

**Author:** ![zombie\_process](https://forums.interworx.com/letter_avatar_proxy/v4/letter/z/7ab992/32.png) [@zombie\_process](https://forums.interworx.com/u/zombie_process)\
**Post date:** [September 9, 2011, 10:16am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/15 "2011-09-09T10:16:53Z")

</div>

RHEL/centos 6 ship with PHP 5.3. Updating to 5.2 by adding the iworx repo is extremely easy on RHEL/centos 5.

---

<div class="post-metadata">

**Author:** ![allwebnow](https://forums.interworx.com/letter_avatar_proxy/v4/letter/a/ec9cab/32.png) [@allwebnow](https://forums.interworx.com/u/allwebnow)\
**Post date:** [September 9, 2011, 10:22am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/16 "2011-09-09T10:22:43Z")

</div>

Yeah, I upgraded using the info here and it took me about 1minute to do it maybe less. But many newbies that are starting a hosting company that want to use interworx aren’t going to know how to do this via command prompt and are going to be scared to do something like this for something so standard as php 5.2. I heard from iworx support they might be supporting newer php versions in future releases.

---

<div class="post-metadata">

**Author:** ![zombie\_process](https://forums.interworx.com/letter_avatar_proxy/v4/letter/z/7ab992/32.png) [@zombie\_process](https://forums.interworx.com/u/zombie_process)\
**Post date:** [September 9, 2011, 1:04pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/17 "2011-09-09T13:04:19Z")

</div>

That’s good to hear. I admit that I think that it’s a bit of a cop out to hear “talk to your distro about upgrading packages” when they only support red hat and respins. I personally have no issues with red hat, but they aren’t known for having the most recent versions of packages, centos less so. Trying to get ruby up to date enough to support rails in a fashion that iworx would see on centos 5.6 was frustrating, so I do absolutely see your point.

All that said, I have absolutely no sympathy at all for anyone wanting to run a hosting biz without enough clue to add a managed repo and run an update from the CLI.

---

<div class="post-metadata">

**Author:** ![SagoJonB](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@SagoJonB](https://forums.interworx.com/u/SagoJonB)\
**Post date:** [June 8, 2012, 3:48pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/18 "2012-06-08T15:48:52Z")

</div>

Any chance this repo will work on a straight up non-Interworx CentOS 5.x server ?

---

<div class="post-metadata">

**Author:** ![Poooh](https://forums.interworx.com/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@Poooh](https://forums.interworx.com/u/Poooh)\
**Post date:** [February 20, 2013, 4:47am UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/19 "2013-02-20T04:47:00Z")

</div>

Hi there,

I upgraded to php 5.2.17 and now, when trying to install php-soap we get the following error:

> yum install php-soap  
> Setting up Install Process  
> Resolving Dependencies  
> –\> Running transaction check  
> —\> Package php-soap.x86\_64 0:5.1.6-39.el5\_8 set to be updated  
> –\> Processing Dependency: php-common = 5.1.6-39.el5\_8 for package: php-soap  
> –\> Finished Dependency Resolution  
> php-soap-5.1.6-39.el5\_8.x86\_64 from base has depsolving problems  
> –\> Missing Dependency: php-common = 5.1.6-39.el5\_8 is needed by package php-soap-5.1.6-39.el5\_8.x86\_64 (base)  
> Error: Missing Dependency: php-common = 5.1.6-39.el5\_8 is needed by package php-soap-5.1.6-39.el5\_8.x86\_64 (base)  
> You could try using --skip-broken to work around the problem  
> You could try running: package-cleanup --problems  
> package-cleanup --dupes  
> rpm -Va --nofiles --nodigest  
> The program package-cleanup is found in the yum-utils package.

and it seems it’s missing 5.1.6 but we’re at 5.2.17.

Any idea on how to solve this?

Thanks,

---

<div class="post-metadata">

**Author:** ![Sanam\_Preetkaur](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/a88e57/32.png) [@Sanam\_Preetkaur](https://forums.interworx.com/u/Sanam_Preetkaur)\
**Post date:** [February 25, 2020, 10:49pm UTC](https://forums.interworx.com/t/how-to-install-php-5-2-through-yum/12592/20 "2020-02-25T22:49:56Z")

</div>

Thanks for posting this, really helpful to me.
