Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install laravel in composer

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

It is believed that many inexperienced people have no idea about how to install laravel in composer. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

First, guide reading

Composer is a tool that php uses to manage dependencies. You can declare the dependent external libraries (libraries) in your project, and composer will help you install these dependent library files.

The composer official website address is: https://getcomposer.org/

Download and install address on composer official website: https://getcomposer.org/downl...

There are two ways to install, one is to download the composer.phar file directly from the official website to install it, and the other is to download and install it directly from the command line. This paper mainly introduces the installation of the command line.

Second, install composer on the command line

Use the php-r command to execute a piece of php code to download the composer-setup.php file

Php-r "copy ('https://getcomposer.org/installer',' composer-setup.php');"

Note: after executing the above command, you will find that the current directory has a composer-setup.php file.

Check, execute the following command:

Php-r "if (hash_file ('SHA384',' composer-setup.php') = '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd5864ca9813a858088ffbc1f233e9b180f061') {echo' Installer verified';} else {echo 'Installer corrupt'; unlink (' composer-setup.php');} echo PHP_EOL;"

Note: if the verification passes after the above command is executed, Installer verified will be output.

Download the php file by performing the above steps

Php composer-setup.php

Note: after execution, a composer.phar file will be generated directly.

Delete the composer-setup.php file:

Php-r "unlink ('composer-setup.php');"

Composer.phar is an executable program in Linux. For example, we can use php composer.phar update to perform update operations. At this point, our composer tool is completely installed, and you can use it to install various dependent library files of php.

To install dependent libraries using composer globally, you can install globally by executing the following command:

Mv composer.phar / usr/local/bin/composer

Note: after that, you can install various packages and dependencies directly using composer install. Usually, however, you only need to add the location of the composer.phar to the PATH, not necessarily a global installation.

3. For installation of other environments, please refer to:

Http://www.thinkyisu.com/topic/...

Http://laravelacademy.org/pos...

IV. Domestic image configuration

Because composer loads foreign images by default, domestic images will make errors when loading foreign images because of the existence of "walls", so domestic images should be configured.

Configure the domestic image to execute the following command:

Composer config-g repo.packagist composer https://packagist.phpcomposer.com V. Install Laravel using composer

The first four major steps are basically successful installation and configuration of composer, then use composer as a tool to install the Laravel framework

From your own site directory, create your own laravel project, for example, name it wxd, and execute the following command:

Composer create-project-- prefer-dist laravel/laravel wxd remarks: if you want to make a version, you can use the following command: composer create-project-- prefer-dist laravel/laravel wxd "5.2.*"

After reading the above, have you mastered how to install laravel in composer? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report