Web Hosting Forum | Lunarpages

Author Topic: PHP and MySQL upgrade tutorial for VPS container with CentOS4  (Read 34141 times)

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
PHP and MySQL upgrade tutorial for VPS container with CentOS4
« on: August 13, 2009, 05:45:30 AM »
Hello,

Here are the instructions on how to get PHP and MySQL upgraded to versions 5 on your VPS with CentOS 4.

1. Backup your VPS via VZPP (accessed via https://your.vps.ip:4643 with the same login details for Plesk administration)

2. Login to the server as root via ssh

3. Install yum using the following commands:

Code: [Select]
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
rpm -ivh --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm

4. Then add Atomic repository that contains PHP for Linux Plesk servers and update PHP and MySQL:

Code: [Select]
rpm -ivh http://www.atomicorp.com/channels/atomic/centos/4/i386/RPMS/atomic-release-1.0-10.el4.art.noarch.rpm
rpm --nodeps -e php-domxml
yum update php*
yum update mysql*
yum install php-xml
mv /etc/php.ini /etc/php.ini.bak (our backup)
mv /etc/php.ini.rpmnew /etc/php.ini


5. Restart Apache and MySQL to pickup the changes:

Code: [Select]
service mysqld restart
service httpd restart

6. Remove yum if you are done with software installations as using "yum upgrade" or installing other packages *MAY* break the VPS:

Code: [Select]
rpm -e `rpm -aq | grep yum`
I hope this helps. Please update this post, if you have any further questions, corrections or suggestions.
« Last Edit: August 13, 2009, 05:47:05 AM by perestrelka »
Kind Regards,
Vlad Artamonov

Offline conga3

  • Knows just enough to get in trouble.
  • Spacescooter Operator
  • *****
  • Posts: 40
    • Conga3
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #1 on: August 13, 2009, 06:32:17 AM »
What about the step to start using the new MySQL INI file?

-Replace /etc/my.cnf with /etc/my.cnf.rpmnew

I just ran this to upgrade my PHP and forgot I get an error :
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)

I have suPHP installed and can't remember if I got this error before suPHP was installed, but I thought I'd also mention it here.

Code: [Select]
chmod 777 /var/lib/php/session
« Last Edit: August 21, 2009, 07:40:10 PM by conga3 »

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #2 on: August 23, 2009, 12:42:52 AM »
What about the step to start using the new MySQL INI file?

-Replace /etc/my.cnf with /etc/my.cnf.rpmnew


I believe it is not needed as Plesk customizes my.cnf and the new version of it does not contain those customizations. Also, new mysql starts and works just fine with the original my.cnf.
Kind Regards,
Vlad Artamonov

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #3 on: October 21, 2009, 08:10:46 PM »
Okay..... I went through the entire process and everything seemed to go okay with the SSH commands..... (I was nervous as hell since I have never done anything like that)

The easiest way for me to make sure things are running okay is to login to my phpbb message board. I can do that fine. I go to the admin panel and I am no longer on PHP 4, I am now on PHP  5.2.11. So everything is fine there.

On MySQL side, it appears that it did not upgrade. phpbb is saying that I am still on version 4.1.20. PLESK is also confirming this..... Did I do something wrong? Wasn't MYSQL supposed to be upgraded to 5 with the command you posted above? When I ran the commands everything seemed to go okay..... Maybe I missed something? It looks like my sites are running fine, am I okay with PHP5 and MySQL 4 running together? or am I just looking for trouble?


EDIT: It looks like it did not upgrade.... Here is the code of what happened when I tried to update mysql and the response:

Code: [Select]
[root@vps ~]# yum update mysql*
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Could not find update match for mysqlauth.Q32013
No Packages marked for Update/Obsoletion
« Last Edit: October 21, 2009, 08:19:15 PM by Jupiter »

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #4 on: October 21, 2009, 08:27:07 PM »
It looks like I had another error when I tried to remove YUM.....
Code: [Select]
[root@vps ~]# rpm -e `rpm -aq | grep yum`
error: Failed dependencies:
yum >= 2.2 is needed by (installed) atomic-release-1.0-10.el4.art.noarch

So does this mean YUM is till installed? How do I remove it?

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #5 on: October 21, 2009, 08:40:37 PM »
Hi Jupiter,

To ensure MySQL got upgraded please run:

Quote
rpm -qa | grep -i mysql

PHP module for MySQL is typically linked with 4.1 library to ensure in stability as all Centos 4 binaries are linked against the same MySQL library.

As for yum removal, you can also remove the atomic-release along with yum:

Quote
rpm -e `rpm -aq | grep yum` atomic-release
Kind Regards,
Vlad Artamonov

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #6 on: October 21, 2009, 08:46:07 PM »
No.. I am still on 4.1.20


Is there something I can do to get it updated? Which commands should I re-run?
« Last Edit: October 21, 2009, 08:51:40 PM by Jupiter »

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #7 on: October 21, 2009, 10:43:55 PM »

Have you already deleted yum and atomic-release? Can you please show the exact output of "rpm -qa | grep -i mysql" here?
Kind Regards,
Vlad Artamonov

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #8 on: October 22, 2009, 04:34:45 AM »
Here is the output...


Code: [Select]
[root@vps ~]# rpm -qa | grep -i mysql
dummymysql-2-1.swsoft
mysql_passwd-0.7-2.swsoft
mysqlclient10-3.23.58-4.RHEL4.1
mysql-server-4.1.20-1.RHEL4.1
perl-DBD-MySQL-2.9004-3.1
mysql-devel-4.1.20-1.RHEL4.1
mysql-4.1.20-1.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
php-mysql-5.2.11-2.el4.art

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #9 on: October 22, 2009, 07:51:53 PM »
It looks like you may have missed what I said above with the output when I tried to update mysql...
Here is what happened when I tried to update mysql:


Code: [Select]
[root@vps ~]# yum update mysql*
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Could not find update match for mysqlauth.Q32013
No Packages marked for Update/Obsoletion

Offline perestrelka

  • Master Jedi
  • *****
  • Posts: 1397
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #10 on: October 22, 2009, 10:43:55 PM »

Yeah, I saw that, but I also wanted to see a list of packages that more than likely relate to MySQL on your server. Can you please try running "yum update mysql*" once again. I see nothing wrong at this moment.
Kind Regards,
Vlad Artamonov

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #11 on: October 23, 2009, 05:33:58 AM »
Did not work..... Here is the entire string of code I just ran.
Code: [Select]
[root@vps ~]# yum update mysql*
Setting up Update Process
Setting up repositories
update                    100% |=========================|  951 B    00:00     
base                      100% |=========================| 1.1 kB    00:00     
atomic                    100% |=========================|  951 B    00:00     
addons                    100% |=========================|  951 B    00:00     
extras                    100% |=========================| 1.1 kB    00:00     
Reading repository metadata in from local files
Could not find update match for mysqlauth.Q32013
No Packages marked for Update/Obsoletion
[root@vps ~]# service mysqld restart
Stopping MySQL:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]
[root@vps ~]# rpm -qa | grep -i mysql
dummymysql-2-1.swsoft
mysql_passwd-0.7-2.swsoft
mysqlclient10-3.23.58-4.RHEL4.1
mysql-server-4.1.20-1.RHEL4.1
perl-DBD-MySQL-2.9004-3.1
mysql-devel-4.1.20-1.RHEL4.1
mysql-4.1.20-1.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
php-mysql-5.2.11-2.el4.art
[root@vps ~]#

Offline Jupiter

  • Spaceship Captain
  • *****
  • Posts: 107
    • Gopher Puck Live
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #12 on: October 26, 2009, 12:10:13 PM »
Anyone home????

Offline watsonovedades

  • Space Explorer
  • ***
  • Posts: 7
    • Hechizos para enamorar
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #13 on: February 07, 2011, 01:54:03 AM »
Hello

when i restart my apache my system crashes,, anyone?
Los mejores Hechizos para enamorar ahora al descubierto

Offline Tom52

  • Spaceship Navigator
  • *****
  • Posts: 85
Re: PHP and MySQL upgrade tutorial for VPS container with CentOS4
« Reply #14 on: March 28, 2012, 05:25:51 PM »
Hello,
 
Here are the instructions on how to get PHP and MySQL upgraded to versions 5 on your VPS with CentOS 4.

1. Backup your VPS via VZPP (accessed via https://your.vps.ip:4643 with the same login details for Plesk administration)

2. Login to the server as root via ssh

3. Install yum using the following commands:

Code: [Select]
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
rpm -ivh --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -ihv --nodeps http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm

4. Then add Atomic repository that contains PHP for Linux Plesk servers and update PHP and MySQL:

Code: [Select]
rpm -ivh http://www.atomicorp.com/channels/atomic/centos/4/i386/RPMS/atomic-release-1.0-10.el4.art.noarch.rpm
rpm --nodeps -e php-domxml
yum update php*
yum update mysql*
yum install php-xml
mv /etc/php.ini /etc/php.ini.bak (our backup)
mv /etc/php.ini.rpmnew /etc/php.ini


5. Restart Apache and MySQL to pickup the changes:

Code: [Select]
service mysqld restart
service httpd restart

6. Remove yum if you are done with software installations as using "yum upgrade" or installing other packages *MAY* break the VPS:

Code: [Select]
rpm -e `rpm -aq | grep yum`
I hope this helps. Please update this post, if you have any further questions, corrections or suggestions.
Great guide thanks.

 

Share |