Page 1 of 2

Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/02/08 16:27:34
by mgnetuk
CentOS 4.4 does not come with PHP5 as standard. I wanted to upgrade my server to PHP5, but found that MySQL is now disabled in PHP5! This is somewhat annoying to say the least. I am not the only one with this gripe, Googling around the Linux/web dev online world came up with some interesting posts.

PHP4 was upgraded to PHP5 from the CentOS plus repository. To use this repo, edit:

/etc/yum.repos.d/Centos-base.repo

and in the CentOS plus section change

enabled=0

to

enabled=1

Then run:

yum update php*


Now, to enable mysql support simply change the following files:

/etc/my.cnf.rpmnew

to

/etc/my.cnf

and

/etc/php.ini.rpmnew

to

/etc/php.ini

using vi, mc, nano or whatever you prefer.

Now restart Apache by typing:

# service httpd restart

You should now have PHP5 WITH mysql support on CentOS 4. :-)

To prove you have PHP5 type

# php -v

Should output something like this:

# php -v
PHP 5.1.6 (cli) (built: Nov 17 2006 08:52:42)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

Enjoy the power of PHP5!

Apologies if this is already posted elsewhere. I hope this helps.

See the original article here:

[url=http://www.mgnetuk.com/wordpress]www.mgnetuk.com/wordpress[/url]

Regards,

Mike

Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/02/08 20:02:19
by teleport
You do not need to modify repo files. "yum --enablerepo=centosplus update php*" will do same thing.

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/02/09 23:01:05
by rawoo
Ah, but what about getting PHP4 and PHP5 existing peacefully side by side on CentOS 4? Anyone have a simple and effective receipe for this?

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/02/12 04:08:38
by pjwelsh
Adding it to the repos.d/files will get any future updates/bug fixes with yum enabled...

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/03/14 22:24:04
by dakine
[root@mark yum.repos.d]# yum update php*
-bash: yum: command not found

Theres directories for yum, why isnt it working?

NOTE: Im a newbie!!

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/03/18 06:50:27
by dakine
I done everything you said and I get this error

--> Finished Dependency Resolution
Error: Missing Dependency: php = 4.3.9-3.22.3 is needed by package php-domxml

How do I fix this??

Thanks in advanced
Mark

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/03/19 13:14:55
by jult
Same here. I've been running my CentOS 4.4 for months on php 5.* now, all was smooth until recently in yum I can't get past the dependencies.

Personally, I don't see reasons to still use php 4.* for anything, but that's just me. I'm not using scripts that still need 4.*

Sure, I know you're being risky when using centosplus or other repositories, but I think the base centos repository can use some major updates by now!

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/04/01 22:31:16
by breun
The [url=http://mirror.centos.org/centos-4/4.4/centosplus/Readme.txt]CentOS Plus repo readme[/url] is pretty clear on this:

[quote]-------------------------
php-5.x.x-x.centos4
-------------------------
This is php-5 for CentOS-4. It replaces the php-4.3.9 that is currently
in CentOS-4. In order to upgrade a current php-4 install, you must
remove php-domxml first and then do:

yum --enablerepo=centosplus upgrade php*

or to do and install, use this command:

yum --enablerepo=centosplus --exclude=php-domxml install php*

(or install individually the files that you need)[/quote]

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/04/01 22:38:17
by breun
[quote]Sure, I know you're being risky when using centosplus or other repositories, but I think the base centos repository can use some major updates by now![/quote]

I think you don't quite get the idea of CentOS. The CentOS base repositories are 100% binary compatible with RHEL. Since RHEL doesn't do version upgrades during a release cycle, CentOS doesn't those either. If you want to upgrade some package to a new major version (PHP4 -> PHP5 for instance), you can choose to do so by using extra repositories like CentOS Plus, but don't expect major version upgrades through the updates channel.

CentOS 5 should be out soon though... :)

Re: Upgrading PHP4 to PHP5 on CentOS the smooth way

Posted: 2007/07/13 04:59:54
by mrpbjnance
-------------------------
php-5.x.x-x.centos4
-------------------------
This is php-5 for CentOS-4. It replaces the php-4.3.9 that is currently
in CentOS-4. In order to upgrade a current php-4 install, you must
remove php-domxml first and then do:

yum --enablerepo=centosplus upgrade php*

or to do and install, use this command:

yum --enablerepo=centosplus --exclude=php-domxml install php*

(or install individually the files that you need)



Sorry newbiew question

Can someone tell me where php-domxml would be.

We want to upgrade from php 4.3.9 to php5 I am from old unix days and VERY confused.
If anyone would be will to show me steps I would be greatful