Steps to upgrade Laravel 5.4 to 5.6 in Ubuntu 16.04

Foreword

This article is only for recording the upgrade process

This article uses the Ubuntu16.04 system, if Windows only needs to change PHPStudy or download the relevant PHP version, I won’t say much, let’s take a look at the detailed introduction.

1、 Confirm and upgrade PHP version

Laravel 5.6 requires the PHP version to be ^7.13, while Laravel 5.4 only requires the ^5.6 version

I installed PHP 7.0 before, so I need to upgrade

Upgrade PHP

Terminal operation:

dpkg --get-selections | grep -v deinstall | grep php7.0

Check which components are installed in PHP

Then follow the steps below to run the upgrade one by one

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.1

sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm

sudo a2dismod php7.0

sudo a2enmod php7.1

sudo service apache2 restart

1.1 I want to remind everyone here

PHP7.2 has a question about Count

Write like this in PHP7.2

<? php
echo count(null);

The following error will be reported:

Warning: count(): Parameter must be an array or an object that implements Countable in

But below PHP7.1

Will return 0

So this time I pitted myself and finally dropped from PHP7.2 back to 7.1

The reason is that many third-party packages use Count but do not handle this error

2、 Modify Laravel's Composer.json

Change the version of PHP to 7.1.3 or above

Change phpunit to 6.0

Delete all php artisan optimize, because this command has been deleted after 5.6

Root terminal run: composer update

After waiting for a while, after updating

Type in the terminal: php artisan -V to view the Laravel version

3、 Log modification

5.4 It is different from the 5.6 log

So you need to add a logging.php configuration file under config, please copy the code inside

https://github.com/laravel/laravel/blob/develop/config/logging.php

Then add LOG_CHANNEL=stack under .env so that the log will not report errors

to sum up

The above is the entire content of this article. I hope that the content of this article has a certain reference value for your study or work. If you have any questions, you can leave a message and exchange. Thank you for your support to ZaLou.Cn.

Recommended Posts

Steps to upgrade Laravel 5.4 to 5.6 in Ubuntu 16.04
ubuntu16.04 method steps to upgrade the kernel
How to upgrade to Ubuntu 20.04
How to upgrade to Ubuntu 20.04
Upgrade Ubuntu 18.04 on Azure to 18.10
How to upgrade to Ubuntu 16.04 LTS
Complete steps to configure IP address in Ubuntu 18.04 LTS
How to install Helm in Ubuntu
How to upgrade CentOS7 to CentOS8 (detailed steps)
How to install mysql in Ubuntu 14.04
How to upgrade to PHP 7 on Ubuntu 14.04
How to install mysql in Ubuntu 14.04
Detailed steps to install MySQL to change the default password in Ubuntu
How to add swap partition in Ubuntu
How to easily compile openJDK in Ubuntu
How to install cuda10.1 driver in Ubuntu
How to delete redundant kernels in Ubuntu
How to delete redundant kernels in Ubuntu
Beautify Ubuntu 18.04 to Mac style in 5 minutes
How to install ROS Noetic in Ubuntu20.04
How to set static IP in ubuntu14.04
Ubuntu20.04 steps to install cuda10.1 (graphic tutorial)
How to modify software source in Ubuntu 7.10
How to open root account in Ubuntu20.04
How to hide applications in Ubuntu Dash?
Ubuntu16 upgrade Python3
Ubuntu14 upgrade MySQL
ubuntu14.04.1 upgrade openssh
ubuntu16.04 upgrade python2
How to upgrade all Python libraries on Ubuntu 18.04
How to modify time zone and time in ubuntu
How to configure TensorFlow use environment in Ubuntu
Detailed steps to install Anaconda on Linux (Ubuntu 18.04)
How to install python in ubuntu server environment
Detailed steps to install Anaconda on Linux (Ubuntu 18.04)
How to use dpkg command in Ubuntu system
How to open the ubuntu system in win10
Steps to add toolkit for Matlab_Linux under ubuntu
How to configure /var/log/messages in Ubuntu system log
Remotely connect to MySQL database in Ubuntu environment
Introduction to the use of Hanlp in ubuntu
How to install Hadoop in standalone mode on Ubuntu 18.04
Install mysql-pytho in Ubuntu
Nagios3 in ubuntu serve
Centos 6.4 python 2.6 upgrade to 2.7
Centos 6.4 python 2.6 upgrade to 2.7
Use supervisor in ubuntu
CentOS6.5 upgrade kernel to 3.10.28
How to view detailed network routing table in Ubuntu
How to use Putty to log in to ubuntu installed in VirtualBox
Detailed steps to install Sogou input method on Ubuntu 20.04
How to modify time zone and time in ubuntu system
Install python in Ubuntu
Install JDK in Ubuntu19.10
Example of how to modify ip address in Ubuntu20.04
Detailed steps to configure Ubuntu 16.04 and Apache virtual host
Remote connection to Ubuntu 19.1
Many attempts to set up soft routing in ubuntu
The specific steps to upgrade python on Raspberry Pi
How to control the ubuntu system in win10 through ssh
Mac uses vnc to remotely log in to the ubuntu16.04 desktop