Here is the step: (but may be there is some lack here and
there in the step)
At the first step I try to upgrade using this step:
Ref: https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-16-04-lts
Then everything turn problem.. All services cannot started :(
Here we go.. lets find out the solution :)
1. I notice that the version of php5 is already replace with php7. Which maybe the culprit of this problem.
2. Mysql also cannot restart.
3. Nginx problem because of the php5-fpm already deinstall and cannot be install again.
Ok.. Lets start to patch;
1. uninstall all the package including all the dependancy of the package mysql.
#dpkg -P --force depends mysql-server mysql-server-5.7 mysql-common mysql-server-core-5.7 php5-mysql mysql-client-5.7 mysql-client-core-5.7 libdbd-mysql-perl libmysqlclient18:amd64 libmysqlclient20:amd64
2. uninstall all the package including all the dependancy of php
#apt-get purge php5-common php5-curl php5-json php5-mysql
3. unistall nginx
#apt autoremove nginx
Then reinstall back
1. apt-get install mysql-server mysql-client mysql-common dbconfig-mysql
2. apt-get install php-fpm php-mysql
Changes in Mysql
#systemctl stop mysql
#nano /etc/mysql/mysql.conf.d/mysqld.cnf
datadir=/mnt/data/mysql
alias /var/lib/mysql/ -> /mnt/data/mysql/,
#systemctl restart apparmor
#systemctl start mysql
Ref: https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-04
Changes in php
Do some changes at
Do some changes at
#nano /etc/php/7.0/fpm/php.ini
;cgi.fix_pathinfo=1
cgi.fix_pathinfo=0
;cgi.fix_pathinfo=1
cgi.fix_pathinfo=0
#systemctl status php7.0-fpm
#systemctl start php7.0-fpm
Changes in Nginx
#nano /etc/nginx/sites-available/default
#systemctl start php7.0-fpm
Changes in Nginx
#nano /etc/nginx/sites-available/default
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
Ref: https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04
Ref: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04
Others command;
apt-cache show mysql-server | grep Version ; check version mysql
dpkg --get-selections | grep php ; check list package with php
lsb_release -a ;check version ubuntu
nginx -t ;test nginx config