Ubuntu16.04 uses composer to install laravel framework

**This tutorial uses the Ubuntu16.04 version of pure mirroring to build the LAMP environment and then installs composer again, and finally installs the Laravel framework using composer. **

Update system##

In the process of running according to the tutorial, it is recommended to use the root user to operate.

sudo apt-get update
sudo apt-get upgrade

Install Apache2

sudo apt-get install apache2 -y #Suspend yes by default
sudo a2enmod rewrite #Enable Apache2 to restrict browsing and use this feature to send web pages

Open the browser and enter http://host location/ to check if the installation is successful, if any, the Apache web page will appear

Apache2 on Ubuntu16.04 Commands in the system
sudo service apache2 start   #Start Apache2 server
sudo service apache2 restart #Restart the Apache2 server
sudo service apache2 stop    #Shut down the Apache2 server

Install PHP

Please make sure that the PHP version is the latest, or that the PHP version is compatible with the Laravel version. If PHP is already installed, but the version is not correct, please remove PHP first:

# Remove packages whose package name starts with PHP
sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
# Join ondrej/PPA for php:In order to install a new version of PHP
sudo apt install python-software-properties

# Update package index
sudo apt-get update
# Install PHP and PHP components
sudo apt install -y php
sudo apt install -y libapache2-mod-php php-curl php-common php-cli php-mysql php-mbstring php-fpm php-xml php-zip php-gettext

First add test.php in /var/www/html, etc., bring in phpinfo, and then open HTTP: //host location/test.php with a browser to see if there is any phpinfo webpage displayed, if only it is displayed Code, that means PHP was not successfully installed:

Supplement: root privileges are required, it is best to switch to root first before operating.

sudo vim /var/www/html/test.php #Add and edit test.php 

#Enter the following code and save
<? php 
phpinfo();?>

Displaying the basic PHP interface at the beginning means that the installation is successful.

Install Mysql

sudo apt install mysql-server mysql-client -y

The installation process will teach you the MySQL root password entered

Verify that Musql is successfully installed:

# Execute mysql operation command
mysql -uroot -P3306 -p
# enter password
# *******
# Go in successfully, it’s OK, don’t forget to come out
exit();

Install PHPMyadmin

sudo apt install phpmyadmin
# The pop-up dialog box to select the server I am here is Apache
sudo ln -s /usr/share/phpmyadmin /var/www/html/PhpMyAdmin

Then restart Apache2, enter http://host location/PhpMyAdmin in the browser to see if you see the login screen, there are representatives of success, pay attention to the case. . .

Install Composer

cd ~ sudd 
php -r "copy('https://getcomposer.org/installer','composer-setup.php');" 
sudo php composer-setup.php 
sudo mv composer.phar /usr/local/bin/composer 
sudo php -r "unlink('composer-setup.php');"

To verify whether composer is installed successfully, simply enter: composer on the command line, and output the composer operation command to show that the installation is successful.

Install Laravel framework##

First switch composer to the Chinese source:

composer config -g repo.packagist composer https://packagist.laravel-china.org

Get Laravel and install it:

composer create-project --prefer-dist laravel/laravel laravel

The installation is complete, but the website cannot be accessed, and authorization is required

chmod 777-R laravel

laravel installed successfully

So far, laravel is installed successfully.

Link to this article: https://www.debuginn.cn/2343.html

This article is licensed under the [CC BY-NC-SA 3.0 Unported] (https://creativecommons.org/licenses/by-nc-sa/3.0/deed.zh) agreement, please keep the link to this article for reprinting

Recommended Posts

Ubuntu16.04 uses composer to install laravel framework
Ubuntu uses Docker to install Gitlab
How to install and use Composer on Ubuntu 18.04
How to install and use Composer on Ubuntu 20.04
How to install Django Web Framework on Ubuntu 18.04
Install scrapy framework on ubuntu
How to install Helm in Ubuntu
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install mysql in Ubuntu 14.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Anaconda on Ubuntu 20.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to install Apache on Ubuntu 20.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04
How to install Mono on Ubuntu 20.04
How to install Go on Ubuntu 20.04
How to install Zoom on Ubuntu 20.04
How to install mysql in Ubuntu 14.04
How to install Nginx on Ubuntu 16.04
How to install OpenCV on Ubuntu 20.04
How to install Spotify on Ubuntu 20.04
How to install Postman on Ubuntu 18.04
How to install Go 1.6 on Ubuntu 16.04
How to install Go on Ubuntu 18.04
How to install MySQL on Ubuntu 14.04
Steps to upgrade Laravel 5.4 to 5.6 in Ubuntu 16.04
How to install Audacious under Ubuntu
How to install PostgreSQL on Ubuntu 20.04
How to install Tensorflow under ubuntu 16.04