Home >Backend Development >PHP Tutorial >Detailed introduction to the method of installing Laravel using Composer in LAMP environment

Detailed introduction to the method of installing Laravel using Composer in LAMP environment

黄舟
黄舟Original
2017-03-27 09:29:301328browse

This article mainly introduces the method of installing ://www.php.cn/php/php-tp-inst in the LAMP environment, with a simple analysis The installation of Composer in the Ubuntu server environment and the related commands and usage skills of using Composer to install Laravel. Friends in need can refer to the following

This article describes the method of using Composer to install Laravel in the LAMP environment. Share it with everyone for your reference, the details are as follows:

Installing Composer

Because we use Ubuntu server, we use apt to install:

$ sudo apt install composer

Install Laravel

First create a project directory, enter the new directory and use Composer to install Laravel:

$ sudo mkdir -p /var/www/html/laravel/my_laravel
$ cd /var/www/html/laravel/
$ sudo composer create-project laravel/laravel --prefer-dist my_laravel

Because Ubuntu’s Apache The www-data user is used to avoid abnormal operation due to permission issues. We set the three directories of public, storage, and vendor to which www-data belongs:

$ sudo chown -R www-data /var/www/html/laravel/my_laravel/public/
$ sudo chown -R www-data /var/www/html/laravel/my_laravel/storage/
$ sudo chown -R www-data /var/www/html/laravel/my_laravel/vendor/

At this point we can use the browser to access Laravel

192.168.56.101/laravel/my_laravel/public/

Note: 192.168.56.101 is my virtual machine IP.

The above is the detailed content of Detailed introduction to the method of installing Laravel using Composer in LAMP environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn