Home > PHP Framework > Laravel > About the initial installation of Laravel

About the initial installation of Laravel

藏色散人
Release: 2020-03-04 15:26:49
forward
3260 people have browsed it

Laravel initial installation

composer installation

composer Chinese mirror:https:// www.phpcomposer.com/

laravel documentation:https://www.php.cn/course/1061.html

curl -sS https://getcomposer.org/installer | php
# 修改 composer 的全局配置文件,修改为中国源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
Copy after login

Install Laravel

Laravel uses Composer to manage dependencies. So, before using Laravel, make sure you have Composer installed on your machine.

There are two ways to follow laravel.

Through the Laravel installer

First, download the Laravel installer using Composer:

composer global require "laravel/installer"
Copy after login

Make sure $HOME/ The .composer/vendor/bin directory (or the equivalent for your operating system) is already placed in your environment variable $PATH so that the system can find the laravel executable.

After installation, the laravel new command will create a new Laravel project in the directory you specify. For example, the laravel new blog command will create a directory named blog, which contains all installed Laravel dependencies:

laravel new blog
Copy after login

Create project through Composer

Alternatively, you can also install Laravel by running the create-project command in the terminal:

composer create-project --prefer-dist laravel/laravel blog "5.5.*"
Copy after login

Local Development Server

If you have PHP installed locally and want to To use PHP's built-in development server to serve your application, use the Artisan command serve. This command will start the development server at http://localhost:8000:

php artisan serve
Copy after login

The above is the detailed content of About the initial installation of Laravel. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template