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!