Upgrade php/mysql

From SME Server
Jump to navigationJump to search
Warning.png Warning:
This howto needs to be tested before to be used in an environment of work....test inside...high risk :)


Warning.png Warning:
For Koozali SME v9 x64 the recommended way is to use the official RHEL php software collection It is a less risky solution, plus you will be able to keep several php versions on your server


Upgrade PHP and MYSQL

Introduction

the purpose of this howto is to upgrade php/mysql with different comfortable way. You can add here your method, please be aware to detail a maximum how to do that.

For SME8

For SME9

From remi repository

Warning.png Warning:
The upgrade is a one way path and you may have some problem with php application see http://forums.contribs.org/index.php/topic,51299.0/topicseen.html

See the above note regarding using Software Collections !


Remi collet provides a huge number of rpm for centos and fedora, the purpose is to use his work.

this is the versions of rpm you will have after :

# rpm -qa phpMyAdmin smeserver-phpMyAdmin_remi mysql-server php
phpMyAdmin-4.2.7-1.el6.remi.noarch
smeserver-phpMyAdmin_remi-4.2.7-1.el6.sme.noarch
php-5.5.15-1.el6.remi.x86_64
mysql-server-5.5.39-1.el6.remi.x86_64

Past all these repositories in your root terminal

/sbin/e-smith/db yum_repositories set remi repository \
Name 'Remi - EL6' \
BaseURL 'http://rpms.famillecollet.com/enterprise/6/remi/$basearch/' \
EnableGroups no \
GPGCheck yes \
GPGKey http://rpms.famillecollet.com/RPM-GPG-KEY-remi \
Visible yes \
Exclude php-horde-horde \
status disabled
/sbin/e-smith/db yum_repositories set remi-php55 repository \
Name 'Remi-php55 - EL6' \
BaseURL 'http://rpms.famillecollet.com/enterprise/6/php55/$basearch/' \
EnableGroups no \
GPGCheck yes \
GPGKey http://rpms.famillecollet.com/RPM-GPG-KEY-remi \
Visible yes \
Exclude php-horde-horde \
status disabled
/sbin/e-smith/db yum_repositories set epel repository \
Name 'Epel - EL6' \
BaseUrl 'http://download.fedoraproject.org/pub/epel/6/$basearch' \
MirrorList 'http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL \
Visible no \
status disabled
db yum_repositories set stephdl repository \
BaseURL http://mirror.de-labrusse.fr/smeserver/\$releasever \
EnableGroups no GPGCheck yes \
Name "Mirror de Labrusse" \
GPGKey http://mirror.de-labrusse.fr/RPM-GPG-KEY \
Visible yes status disabled
signal-event yum-modify
  • Then we need to upgrade php
yum --enablerepo=remi-php55,remi,epel update php\* mysql-server
  • we need to activate innodb

Now with mysql 5.5 innodb is activated by default, and of course not in smeserver


Important.png Note:
On SME8, you need to create a custom-template to remove an obsolete directive
mkdir -p /etc/e-smith/templates-custom/etc/my.cnf
sed -e  's/$OUT .= "innodb_log_arch_dir = .*//g' /etc/e-smith/templates/etc/my.cnf/009innodb > \
  /etc/e-smith/templates-custom/etc/my.cnf/009innodb

This is not required on SME9



db configuration setprop mysqld InnoDB enabled
expand-template /etc/my.cnf
sv t /service/mysqld
  • Running the mysql_upgrade command is mandatory

It checks all tables in all databases for incompatibilities with the current version of MySQL Server. If a table is found to have a possible incompatibility, it is checked. If any problems are found, the table is repaired

mysql_upgrade
  • allow_call_time_pass_reference is deprecated

there is a warning in log, concerning allow_call_time_pass_reference which is deprecated in php55.

mkdir -p /etc/e-smith/templates-custom/etc/php.ini/
sed -e  "s|allow_call_time_pass_reference|//allow_call_time_pass_reference|g" \
   /etc/e-smith/templates/etc/php.ini/10LanguageOptions > /etc/e-smith/templates-custom/etc/php.ini/10LanguageOptions
expand-template /etc/php.ini
/etc/init.d/httpd-e-smith restart
  • restart the server
signal-event post-upgrade; signal-event reboot
  • check the upgrade

after the reboot verify that the mysqld server is started

service mysqld status

and see which version of php you have

php -v


Important.png Note:
Now each time you will need a dependancies, you will have to use remi,remi-php55 and also probably epel. For example :
yum install --enablerepo=epel,remi,remi-php55,stephdl smeserver-phpMyAdmin_remi

It will be the same if you want to update your server. For example :

yum update --enablerepo=remi,remi-php55,stephdl


  • Installation of smeserver-phpmyadmin

Just indispensable :)

yum install --enablerepo=epel,remi,remi-php55,stephdl smeserver-phpMyAdmin_remi
signal-event console-save