Home > Backend Development > PHP Tutorial > Initial installation of Laravel

Initial installation of Laravel

不言
Release: 2023-04-02 16:30:02
Original
1504 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

Laravel Use Composer to manage dependencies. So, before using Laravel, please make sure Composer is 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 The $HOME/.composer/vendor/bin directory (or the equivalent for your operating system) has been placed in your environment variable $PATH so that the system can find it ## Executable file for #laravel.

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 that 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
locally Development Server

If you have a local installation of

PHP and want to use the PHP built-in development server to serve your application, then use Artisan Commandserve. This command will start the development server on http://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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template