Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 08:06:20 PM

Pages: [1]   Go Down
  Print  
Author Topic: PHP and MySQL upgrade tutorial for VPS container with CentOS4  (Read 7192 times)
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« on: August 13, 2009, 06: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:
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:
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:
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:
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, 06:47:05 AM by perestrelka » Logged

Kind Regards,
Vlad Artamonov
conga3
Knows just enough to get in trouble.
Spacescooter Operator
*****
Offline Offline

Posts: 39


WWW
« Reply #1 on: August 13, 2009, 07: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:
chmod 777 /var/lib/php/session
« Last Edit: August 21, 2009, 08:40:10 PM by conga3 » Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #2 on: August 23, 2009, 01: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.
Logged

Kind Regards,
Vlad Artamonov
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #3 on: October 21, 2009, 09: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:
[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, 09:19:15 PM by Jupiter » Logged
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #4 on: October 21, 2009, 09:27:07 PM »

It looks like I had another error when I tried to remove YUM.....
Code:
[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?
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #5 on: October 21, 2009, 09: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
Logged

Kind Regards,
Vlad Artamonov
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #6 on: October 21, 2009, 09: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, 09:51:40 PM by Jupiter » Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #7 on: October 21, 2009, 11: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?
Logged

Kind Regards,
Vlad Artamonov
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #8 on: October 22, 2009, 05:34:45 AM »

Here is the output...


Code:
[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
Logged
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #9 on: October 22, 2009, 08: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:
[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
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #10 on: October 22, 2009, 11: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.
Logged

Kind Regards,
Vlad Artamonov
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #11 on: October 23, 2009, 06:33:58 AM »

Did not work..... Here is the entire string of code I just ran.
Code:
[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 ~]#
Logged
Jupiter
Spaceship Captain
*****
Offline Offline

Posts: 107


WWW
« Reply #12 on: October 26, 2009, 01:10:13 PM »

Anyone home?Huh
Logged
watsonovedades
Space Explorer
***
Offline Offline

Posts: 7


WWW
« Reply #13 on: February 07, 2011, 01:54:03 AM »

Hello

when i restart my apache my system crashes,, anyone?
Logged

Los mejores Hechizos para enamorar ahora al descubierto
Pages: [1]   Go Up
  Print  
 
Jump to: