Initial installation of Laravel

不言
Release: 2023-04-02 16:30:02
Original
1409 people have browsed it

This article mainly introduces the initial installation of Laravel, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

Laravel's initial installation

composer Install

composer Chinese image
laravel document

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

Install Laravel

LaravelUseComposerto manage dependencies. So, before usingLaravel, please make sureComposeris installed on your machine.
There are two ways to followlaravel.

Through the Laravel installer

First, download the Laravel installer using Composer:

composer global require "laravel/installer"
Copy after login

Make sure The$HOME/.composer/vendor/bindirectory (or the equivalent for your operating system) has been placed in your environment variable$PATHso that the system can find it ## Executable file for #laravel.

After installation, the

laravel newcommand will create a new Laravel project in the directory you specify. For example, thelaravel new blogcommand will create a directory namedblogthat contains all installedLaraveldependencies:

laravel new blog
Copy after login
Create project through Composer

Alternatively, you can also install

Laravelby running thecreate-projectcommand in the terminal:

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

If you have a local installation of

PHPand want to use thePHPbuilt-in development server to serve your application, then useArtisanCommandserve. This command will start the development server onhttp://localhost:8000:

php artisan serve
Copy after login
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please Follow PHP Chinese website!

Related recommendations:

Laravel5.5 solution to the problem that the table is empty when executing the table migration command

laravel Redis simply implements queue passing High concurrency processing of stress testing

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

Related labels:
source:php.cn
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!