Page 1 of 2

have to go to php 5

Posted: Fri Aug 24, 2007 12:49 pm
by modom46
Hi,

I just want to ask for some advice.

I will need to update php 4.3 that's on my server now to php 5 for a new ecommerce store that is releasing a beta version soon. I want to keep mysql at version 4.x.

I have plesk 8.1 and centos 4 on my server.

Should I get the centos php 5 from the centos repository for the future when the server will be updated also?

Or should I use the atomic one?

Are there any problems with doing this?

I checked and have this php-pear:
Installed Packages
Name : php-pear
Arch : i386
Version: 4.3.9
Release: 3.22.5
Size : 1.2 M
Repo : installed
===================

/etc/php.ini = memory_limit = 32M


This is a little frightening to me since I have ecommerce stores running now on my server and cannot afford to have them go down and i am changing these stores over to be php 5 compatible now.

Thanks!

Posted: Mon Aug 27, 2007 9:23 am
by Highland
Should I get the centos php 5 from the centos repository for the future when the server will be updated also?
You should install for whatever OS you are using now. i.e. if that's FC5, install for FC5. Each repo is built for that specific OS. If you've not installed the atomic repos, Scott has some handy install scripts on the download page off the main site.

You shouldn't have any major problems with the upgrade save one potential. Whenever I reimage to CentOS 4 it installs PHP 4.3.9. Trying to do a yum upgrade failed because of the php-pear package. If you get an error upgrading that package, try installing it (not upgrading it) by itself and then do the php upgrade.

Posted: Mon Aug 27, 2007 10:45 am
by modom46
Right now I am running centos 4.3 with plesk 8.1 and there's no php 5 for this as I can see.

I checked and have this php-pear:
Installed Packages
Name : php-pear
Arch : i386
Version: 4.3.9
Release: 3.22.5
Size : 1.2 M
Repo : installed

Is this the correct php-pear for php4 and php5?

I cannot find what scripts you posted.

Scott has a rpm for centos 4 here:
http://www.atomicorp.com/channels/atomi ... 6/headers/

but there is not one for the centos repository for centos 4 here:
http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/

The only php5 at the centos repository is with centos 5 and I use centos 4.

Posted: Thu Aug 30, 2007 1:01 pm
by modom46
Since there is not a php5 on the centos4 repository then I should use Scott's php5 that he has listed under centos4 in his repository ... is this correct?

Is there anything else I need to watch out for when upgrading to php5 on centos 4.3?

Posted: Thu Aug 30, 2007 2:08 pm
by Highland
Ok, try this (omit the # as that lets you know that this is a new command)

1. Download the CentOS 4.x installer onto your server.
2. Install the file
#rpm -ivh atomic-release-1.0-6.el4.art.noarch.rpm
3. Run yum. Keep in mind that if you've not run yum before this will pull out a very long list (current release is 4.5)
#yum update -y
During the install process it may halt and ask you if you want to install the ART GPG key. Say yes.

P.S. The install may fail because of php-pear. If that happens do this and re-run yum
#yum install php-pear
4. Replace the php.ini file with the new one and restart Apache
#mv /etc/php.ini /etc/php.ini.old
#mv /etc/php.ini.rpmnew /etc/php.ini
#apachectl graceful
That's all you should need to do. You should be running PHP5 afterwards
# rpm -q php
php-5.2.3-4.el4.art

# php -v
PHP 5.2.3 (cli) (built: Aug 27 2007 08:18:18)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with the ionCube PHP Loader v3.1.31, Copyright (c) 2002-2007, by ionCube Ltd.

Posted: Thu Aug 30, 2007 3:14 pm
by modom46
Thanks!!!

That sounds simple enough. Now just hope my osCommerce stores run properly since they have all been updated for php5.

Thanks again ... this is very good information!

Posted: Thu Aug 30, 2007 4:02 pm
by scott
Steps 1 and 2 can be replaced with:

wget -q -O - http://www.atomicorp.com/installers/atomic.sh |sh

This will also set up yum correctly on RHEL4, and on a VPS that has had yum removed.

Posted: Thu Aug 30, 2007 11:31 pm
by modom46
Hi,

Just wanted to let you know that I updated to php 5 about an hour ago and tested a few stores and everything is working great!

Thanks for all your help! I really appreciate it!

Posted: Fri Aug 31, 2007 6:06 am
by breun
The upgrade has already been performed apparently, but here goes anyway:

* CentOS 4 comes with PHP 4 and distro's like Fedora/RHEL/CentOS never do version upgrades during the lifetime of a release (they like backporting), so CentOS 4 will never have 'official' PHP 5 packages in its repostories.
* There is a CentOS Plus repository which has PHP 5 and newer versions of a couple of other things. See http://mirror.centos.org/centos-4/4.5/c ... Readme.txt for more info.
* The other option for PHP 5 on CentOS 4 is of course ART's atomic repo here.

Posted: Fri Aug 31, 2007 10:28 pm
by modom46
Thanks!

I am trying to test a new ecommerce store and it says I need these:

[root@godslove ~]# rpm -q pdo/mysql
[root@godslove ~]# rpm -q mysqli
[root@godslove ~]# rpm -q mcrypt
[root@godslove ~]# rpm -q mhash
[root@godslove ~]# rpm -q simplexml
[root@godslove ~]# rpm -q DOM

I am on Scott's php 5. I cannot find these either here or at the centos repository.

Where would I get these?

Thanks!

Posted: Sat Sep 01, 2007 4:16 am
by breun
Those are not the correct package names. Try php-pdo, php-mysql and php-xml (although I think you'll already have those). I don't believe Scott has php-mhash and php-mcrypt though.

Posted: Sat Sep 01, 2007 9:20 am
by modom46
Hi Breun,

I checked and it shows:
[root@godslove ~]# rpm -q php-pdo
php-pdo-5.2.3-4.el4.art
[root@godslove ~]# rpm -q php-mysql
php-mysql-5.2.3-4.el4.art
[root@godslove ~]# rpm -q php-xml
php-xml-5.2.3-4.el4.art

I need these:

[root@godslove ~]# rpm -q mysqli
[root@godslove ~]# rpm -q mcrypt
[root@godslove ~]# rpm -q mhash
[root@godslove ~]# rpm -q simplexml
[root@godslove ~]# rpm -q DOM

If I already have php-mysql then why mysqli?

Is simplexml the same as php-xml?

Posted: Sat Sep 01, 2007 12:24 pm
by scott
php-mysql includes mysqli

Posted: Sat Sep 01, 2007 12:53 pm
by modom46
Thanks!

I will definitely need this to start the install:
PHP Extension "mcrypt" must be loaded

Do you know where I can get this and any settings I need to change?

Posted: Sat Sep 01, 2007 1:55 pm
by modom46
I found the rpms for:

[root@godslove ~]# rpm -Uvh mcrypt-2.6.4-2.i386.rpm
warning: mcrypt-2.6.4-2.i386.rpm: V3 DSA signature: NOKEY, key ID 0bf3040b
error: Failed dependencies:
libmcrypt is needed by mcrypt-2.6.4-2.i386
libmcrypt.so.4 is needed by mcrypt-2.6.4-2.i386
libmhash.so.2 is needed by mcrypt-2.6.4-2.i386

wget http://www.ottolander.nl/opensource/rpm ... a.i386.rpm
wget http://www.ottolander.nl/opensource/rpm ... a.i386.rpm

but am still not able to install mcrypt-2.6.4-2 because it still needs:
libmhash.so.2 ... still looking.