Aktualizacja PHP i MySQL na CentOS 6

Bardzo chwalę sobie CentOSa jako system pod server/VPS. Narzekać można jedynie często na dość stare paczki. Można to prosto rozwiązać dodatkowymi repozytoriami i podmianą paczek. W tym wpisie, krótki opis.

Instalacja repozytoriów

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm
rpm -Uvh epel-release-6-5.noarch.rpm
rpm -Uvh ius-release-1.0-13.ius.centos6.noarch.rpm
yum clean all
yum update

Sprawdzenie instalacji

yum list | grep -w \.ius\.

Podmianka paczek

yum install yum-plugin-replace #niezbędne do podmienienia paczek z innych repozytoriów
rpm -qa | grep php
yum replace php --replace-with php55u
rpm -qa | grep mysql
yum replace mysql --replace-with mysql56u

Restart serwera httpd/PHP oraz MySQL

service httpd restart
service mysqld restart

I teraz ma działać na nowej wersji PHP i MySQL :)

[root@vps ~]# php -v
PHP 5.5.16 (cli) (built: Sep 2 2014 08:49:01)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

[root@vps ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 106
Server version: 5.6.20 Distributed by The IUS Community Project

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------------------+
| innodb_version | 5.6.20 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.6.20 |
| version_comment | Distributed by The IUS Community Project |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+------------------------------------------+
7 rows in set (0.00 sec)

Komentarze

9 odpowiedzi na „Aktualizacja PHP i MySQL na CentOS 6”

  1. Witam,
    przy wpisaniu yum update wyskakuje mi error
    co może być przyczyną ??

    [root@]# yum update
    Loaded plugins: fastestmirror, priorities
    Determining fastest mirrors
    Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

    1. Możliwe, że posiadasz CentOSa w wersji 32 bitowej, a zainstalowałeś repozytoria dla 64 bitowego. Tutaj masz wszystkie repozytoria (wystarczy URL zmienić) http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/.

      Lub masz starszą wersję (np. 5).

      W razie czego jeszcze tutaj masz repozytoria EPEL http://fedoraproject.org/wiki/EPEL.

  2. Według dostawcy Vps jest to wersja 6 i 64 bity

    1. Wklep sobie: cat /etc/redhat-release
      Zobaczysz jaką masz wersję.

      Poza tym spróbuj dodać pierw repozytoria EPEL, a potem wg tego wpisu. Możliwe, że tutaj tkwi problem. Dodatkowo wklep: yum clean all & yum update
      Po wszystkim oczywiście.

      1. Ściągnąłem zainstalowałem i dalej mam php 5.3.29
        przy ponownej próbie mam informację, że jest ok a php dalej 5.3.29
        o co chodzi ??

        [root@ /]# rpm -Uvh epel-release-6-5.noarch.rpm
        Preparing… ###### [100%]
        package epel-release-6-8.noarch (which is newer than epel-release-6-5.noarch) is already installed

        [root@ /]# rpm -Uvh ius-release-1.0-13.ius.centos6.noarch.rpm
        Preparing… ######### [100%]
        package ius-release-1.0-13.ius.centos6.noarch is already installed

        Package yum-plugin-replace-0.2.7-1.ius.centos6.noarch already installed and latest version
        Nothing to do

        PHP 5.3.29 (cli) (built: Mar 5 2015 17:07:51)
        Copyright (c) 1997-2014 The PHP Group
        Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
        with the ionCube PHP Loader v4.7.4, Copyright (c) 2002-2014, by ionCube Ltd., and
        with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

        1. A paczki zostały podmienione? Musisz zrobić krok po kroku bo inaczej nie przejdzie i nadal będzie stara wersja.
          Podmianka paczek

          yum install yum-plugin-replace #niezbędne do podmienienia paczek z innych repozytoriów
          rpm -qa | grep php
          yum replace php –replace-with php55u
          rpm -qa | grep mysql
          yum replace mysql –replace-with mysql56u

          1. wywala na podmianie paczek ;(

            [root@directadmin /]# wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
            –2015-03-06 10:35:52– http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
            Resolving dl.iuscommunity.org… rpm -Uvh epel-release-6-5.noarch.rpm
            rpm -Uvh ius-release-1.0-13.ius.centos6.noarch.rpm
            yum clean all
            yum update104.130.201.30, 2001:4801:7827:102:bddb:e4a6:b702:d4ab
            Connecting to dl.iuscommunity.org|104.130.201.30|:80… connected.
            HTTP request sent, awaiting response… 200 OK
            Length: 13160 (13K) [application/x-rpm]
            Saving to: “epel-release-6-5.noarch.rpm.4”

            100%[======================================>] 13,160 –.-K/s in 0s

            2015-03-06 10:35:52 (27.1 MB/s) – “epel-release-6-5.noarch.rpm.4” saved [13160/13160]

            [root@directadmin /]# wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm
            –2015-03-06 10:35:52– http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm
            Resolving dl.iuscommunity.org… 104.130.201.30, 2001:4801:7827:102:bddb:e4a6:b702:d4ab
            Connecting to dl.iuscommunity.org|104.130.201.30|:80… connected.
            HTTP request sent, awaiting response… 200 OK
            Length: 8128 (7.9K) [application/x-rpm]
            Saving to: “ius-release-1.0-13.ius.centos6.noarch.rpm.4”

            100%[======================================>] 8,128 –.-K/s in 0s

            2015-03-06 10:35:53 (493 MB/s) – “ius-release-1.0-13.ius.centos6.noarch.rpm.4” saved [8128/8128]

            [root@directadmin /]# rpm -Uvh epel-release-6-5.noarch.rpm
            Preparing… ########################################### [100%]
            package epel-release-6-8.noarch (which is newer than epel-release-6-5.noarch) is already installed
            [root@directadmin /]# rpm -Uvh ius-release-1.0-13.ius.centos6.noarch.rpm
            Preparing… ########################################### [100%]
            package ius-release-1.0-13.ius.centos6.noarch is already installed
            [root@directadmin /]# yum clean all
            Loaded plugins: fastestmirror, replace
            Cleaning repos: base epel extras ius remi remi-php55 updates vz-base vz-updates
            Cleaning up Everything
            Cleaning up list of fastest mirrors
            [root@directadmin /]# yum update
            Loaded plugins: fastestmirror, replace
            Setting up Update Process
            Determining fastest mirrors
            epel/metalink | 28 kB 00:00
            * base: centos.hitme.net.pl
            * epel: http://ftp.icm.edu.pl
            * extras: centos.hitme.net.pl
            * ius: mirror.amsiohosting.net
            * remi: remi.check-update.co.uk
            * remi-php55: remi.check-update.co.uk
            * updates: centos.hitme.net.pl
            base | 3.7 kB 00:00
            base/primary_db | 4.6 MB 00:00
            epel | 4.4 kB 00:00
            epel/primary_db | 6.4 MB 00:00
            extras | 3.4 kB 00:00
            extras/primary_db | 30 kB 00:00
            ius | 2.1 kB 00:00
            ius/primary_db | 172 kB 00:00
            remi | 2.9 kB 00:00
            remi/primary_db | 1.1 MB 00:00
            remi-php55 | 2.9 kB 00:00
            remi-php55/primary_db | 174 kB 00:00
            updates | 3.4 kB 00:00
            updates/primary_db | 2.1 MB 00:00
            vz-base | 951 B 00:00
            vz-base/primary | 1.3 kB 00:00
            vz-base 3/3
            vz-updates | 951 B 00:00
            vz-updates/primary | 2.2 kB 00:00
            vz-updates 8/8
            No Packages marked for Update
            [root@directadmin /]# yum list | grep -w \.ius\.
            * ius: mirror.amsiohosting.net
            yum-plugin-replace.noarch 0.2.7-1.ius.centos6 @ius
            apcu-panel55u.noarch 4.0.7-3.ius.centos6 ius
            apcu-panel56u.noarch 4.0.7-4.ius.centos6 ius
            apr15u.x86_64 1.5.1-3.ius.centos6 ius
            apr15u-debuginfo.x86_64 1.5.1-3.ius.centos6 ius
            apr15u-devel.x86_64 1.5.1-3.ius.centos6 ius
            apr15u-util.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-debuginfo.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-devel.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-ldap.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-mysql.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-nss.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-odbc.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-openssl.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-pgsql.x86_64 1.5.4-3.ius.centos6 ius
            apr15u-util-sqlite.x86_64 1.5.4-3.ius.centos6 ius
            emacs-git2u.noarch 2.3.0-1.ius.centos6 ius
            emacs-git2u-el.noarch 2.3.0-1.ius.centos6 ius
            git2u.x86_64 2.3.0-1.ius.centos6 ius
            git2u-all.noarch 2.3.0-1.ius.centos6 ius
            git2u-bzr.noarch 2.3.0-1.ius.centos6 ius
            git2u-cvs.noarch 2.3.0-1.ius.centos6 ius
            git2u-daemon.x86_64 2.3.0-1.ius.centos6 ius
            git2u-debuginfo.x86_64 2.3.0-1.ius.centos6 ius
            git2u-email.noarch 2.3.0-1.ius.centos6 ius
            git2u-gui.noarch 2.3.0-1.ius.centos6 ius
            git2u-p4.noarch 2.3.0-1.ius.centos6 ius
            git2u-svn.x86_64 2.3.0-1.ius.centos6 ius
            gitk2u.noarch 2.3.0-1.ius.centos6 ius
            gitweb2u.noarch 2.3.0-1.ius.centos6 ius
            libmemcached10.x86_64 1.0.16-1.ius.centos6 ius
            libmemcached10-debuginfo.x86_64 1.0.16-1.ius.centos6 ius
            libmemcached10-devel.x86_64 1.0.16-1.ius.centos6 ius
            mod24u_ldap.x86_64 2.4.12-3.ius.centos6 ius
            mod24u_proxy_html.x86_64 1:2.4.12-3.ius.centos6 ius
            mod24u_session.x86_64 2.4.12-3.ius.centos6 ius
            mod24u_ssl.x86_64 1:2.4.12-3.ius.centos6 ius
            perl-Git2u.noarch 2.3.0-1.ius.centos6 ius
            perl-Git2u-SVN.noarch 2.3.0-1.ius.centos6 ius
            python27.x86_64 2.7.9-3.ius.centos6 ius
            python27-backports.x86_64 1.0-3.ius.centos6 ius
            3.4.0.2-2.ius.centos6 ius
            python27-debug.x86_64 2.7.9-3.ius.centos6 ius
            python27-debuginfo.x86_64 2.7.9-3.ius.centos6 ius
            python27-devel.x86_64 2.7.9-3.ius.centos6 ius
            python27-libs.x86_64 2.7.9-3.ius.centos6 ius
            python27-lxml.x86_64 3.4.2-1.ius.centos6 ius
            python27-lxml-debuginfo.x86_64 3.4.2-1.ius.centos6 ius
            python27-mod_wsgi.x86_64 4.4.8-1.ius.centos6 ius
            python27-mod_wsgi-debuginfo.x86_64 4.4.8-1.ius.centos6 ius
            python27-pip.noarch 6.0.8-1.ius.centos6 ius
            python27-psutil.x86_64 2.2.1-1.ius.centos6 ius
            python27-psutil-debuginfo.x86_64 2.2.1-1.ius.centos6 ius
            python27-setuptools.noarch 12.1-1.ius.centos6 ius
            python27-test.x86_64 2.7.9-3.ius.centos6 ius
            python27-tools.x86_64 2.7.9-3.ius.centos6 ius
            python27-virtualenv.noarch 12.0.7-1.ius.centos6 ius
            python27-wheel.noarch 0.24.0-1.ius.centos6 ius
            python32.x86_64 3.2.6-1.ius.centos6 ius
            python32-debug.x86_64 3.2.6-1.ius.centos6 ius
            python32-debuginfo.x86_64 3.2.6-1.ius.centos6 ius
            python32-devel.x86_64 3.2.6-1.ius.centos6 ius
            python32-hiredis.x86_64 0.1.6-1.ius.centos6 ius
            python32-hiredis-debuginfo.x86_64 0.1.6-1.ius.centos6 ius
            python32-libs.x86_64 3.2.6-1.ius.centos6 ius
            python32-lxml.x86_64 3.4.2-1.ius.centos6 ius
            python32-lxml-debuginfo.x86_64 3.4.2-1.ius.centos6 ius
            python32-mod_wsgi.x86_64 4.4.8-1.ius.centos6 ius
            python32-mod_wsgi-debuginfo.x86_64 4.4.8-1.ius.centos6 ius
            python32-postgresql.x86_64 1.1.0-2.ius.centos6 ius
            python32-postgresql-debuginfo.x86_64 1.1.0-2.ius.centos6 ius
            python32-redis.noarch 2.10.3-1.ius.centos6 ius
            python32-setuptools.noarch 12.1-1.ius.centos6 ius
            python32-test.x86_64 3.2.6-1.ius.centos6 ius
            python32-tkinter.x86_64 3.2.6-1.ius.centos6 ius
            python32-tools.x86_64 3.2.6-1.ius.centos6 ius
            python33.x86_64 3.3.6-1.ius.centos6 ius
            python33-debug.x86_64 3.3.6-1.ius.centos6 ius
            python33-debuginfo.x86_64 3.3.6-1.ius.centos6 ius
            python33-devel.x86_64 3.3.6-1.ius.centos6 ius
            python33-hiredis.x86_64 0.1.6-1.ius.centos6 ius
            python33-hiredis-debuginfo.x86_64 0.1.6-1.ius.centos6 ius
            python33-libs.x86_64 3.3.6-1.ius.centos6 ius
            python33-lxml.x86_64 3.4.2-1.ius.centos6 ius
            python33-lxml-debuginfo.x86_64 3.4.2-1.ius.centos6 ius
            python33-mod_wsgi.x86_64 4.4.8-1.ius.centos6 ius
            python33-mod_wsgi-debuginfo.x86_64 4.4.8-1.ius.centos6 ius
            python33-postgresql.x86_64 1.1.0-1.ius.centos6 ius
            python33-postgresql-debuginfo.x86_64 1.1.0-1.ius.centos6 ius
            python33-redis.noarch 2.10.3-1.ius.centos6 ius
            python33-setuptools.noarch 12.1-1.ius.centos6 ius
            python33-test.x86_64 3.3.6-1.ius.centos6 ius
            python33-tkinter.x86_64 3.3.6-1.ius.centos6 ius
            python33-tools.x86_64 3.3.6-1.ius.centos6 ius
            python34u.x86_64 3.4.2-1.ius.centos6 ius
            python34u-debug.x86_64 3.4.2-1.ius.centos6 ius
            python34u-debuginfo.x86_64 3.4.2-1.ius.centos6 ius
            python34u-devel.x86_64 3.4.2-1.ius.centos6 ius
            python34u-libs.x86_64 3.4.2-1.ius.centos6 ius
            python34u-pip.noarch 6.0.8-1.ius.centos6 ius
            python34u-redis.noarch 2.10.3-1.ius.centos6 ius
            python34u-setuptools.noarch 12.1-1.ius.centos6 ius
            python34u-test.x86_64 3.4.2-1.ius.centos6 ius
            python34u-tkinter.x86_64 3.4.2-1.ius.centos6 ius
            python34u-tools.x86_64 3.4.2-1.ius.centos6 ius
            python34u-wheel.noarch 0.24.0-1.ius.centos6 ius
            redis28u.x86_64 2.8.19-1.ius.centos6 ius
            redis28u-debuginfo.x86_64 2.8.19-1.ius.centos6 ius
            rsync31u.x86_64 3.1.1-3.ius.centos6 ius
            rsync31u-debuginfo.x86_64 3.1.1-3.ius.centos6 ius
            tkinter27.x86_64 2.7.9-3.ius.centos6 ius
            [root@directadmin /]# yum install yum-plugin-replace #niezbędne do podmienienia paczek z innych repozytoriów
            Loaded plugins: fastestmirror, replace
            Setting up Install Process
            Loading mirror speeds from cached hostfile
            * base: centos.hitme.net.pl
            * epel: http://ftp.icm.edu.pl
            * extras: centos.hitme.net.pl
            * ius: mirror.amsiohosting.net
            * remi: remi.check-update.co.uk
            * remi-php55: remi.check-update.co.uk
            * updates: centos.hitme.net.pl
            Package yum-plugin-replace-0.2.7-1.ius.centos6.noarch already installed and latest version
            Nothing to do
            [root@directadmin /]# rpm -qa | grep php
            [root@directadmin /]# yum replace php –replace-with php55u
            Loaded plugins: fastestmirror, replace
            Replacing packages takes time, please be patient…
            Error: Package 'php’ is not installed.
            [root@directadmin /]# rpm -qa | grep mysql
            [root@directadmin /]# yum replace mysql –replace-with mysql56u
            Loaded plugins: fastestmirror, replace
            Replacing packages takes time, please be patient…
            Error: Package 'mysql’ is not installed.

          2. Bo to w ogóle wygląda jakbyś nie miał wcześniej php i mysql zainstalowanego. ewentualnie masz zainstalowany ale skompilowany ręcznie.

            Spróbuj pierw zainstalować poprzez yum install php, lub yum install php5 oraz yum install mysql, lub yum install mysql5 (piszę z głowy, więc musisz spróbować).

            A jeśli masz skompilowane ręcznie, to musisz usunąć i z repozytoriów zainstalować.

          3. A na pewno nie masz zainstalowanego php z oficjalnych repozytoriów. Przeszukaj sobie z jakiej paczki masz zainstalowane php. I dopiero te wersję zamieniaj. Jeśli masz np w systemie php53 to tę musisz podmienić. Nie da się podmienić czegoś, czego nie ma (mowa o samym php).

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *