Home > Article > PHP Framework > laravel mirror installation
With the increasing popularity of Laravel, we often encounter some problems when installing Laravel. Many of these problems are network-related, such as slow download speeds. This article will introduce how to use Laravel mirror to accelerate installation to improve installation efficiency.
1. What is Laravel mirror
Laravel mirror refers to an alternative download source that is different from the official Laravel source. It has the same files as the official Laravel source, but has faster download speeds, allowing users to download and install Laravel faster.
2. How to use Laravel image
We can add --prefer-dist## to the command line #Option to install Laravel using the Laravel image. An example is as follows:
composer create-project --prefer-dist laravel/laravel project-nameIf your network environment is not very good, you may encounter slow downloading or downloading failure. At this time, you can replace the official Laravel source with a domestic source that responds faster in China. Taking Alibaba Cloud's Composer image as an example, we can set the Composer image installation URL globally.
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/At this time, when using Composer to install Laravel, Composer will give priority to using Alibaba Cloud's Composer image to download the required files, making the entire process faster and smoother.
composer config -g repositories.laravel composer https://mirrors.aliyun.com/composer/In this way, when installing Laravel, Composer will automatically download the required files from Alibaba Cloud's Laravel image to speed up the download. 3. How to configure Laravel image
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer config -g repo.laravelchina composer https://packagist.laravel-china.orgIn addition, Laravel China also provides a Symfony-based mirror source, which has multiple servers and is suitable for users from all over the country. You can use the following command to set up the Symfony mirror:
composer config -g repo.symfony composer https://php.cnpkg.orgNote:
composer config -g repo.packagist composer https://packagist.org
The above is the detailed content of laravel mirror installation. For more information, please follow other related articles on the PHP Chinese website!