HOW TO: Install PHP 5.2 through yum

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. :wink:

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/

 [[email protected] ~]$ 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.

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

3.) Now run yum update.

[[email protected] ~]$ yum update

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

==================================================================================================
 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]:

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?

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.

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

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

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

--> 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?

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.

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.

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 :slight_smile:

[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

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=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?

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.

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.

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?

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

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.

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.

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

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,

Thanks for posting this, really helpful to me.