In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to install laravel in composer under mac/linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
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/download/
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.
III. 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
Use composer to install Laravel
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
Note: if you want to develop a version, you can use the following command:
Composer create-project-prefer-dist laravel/laravel wxd "5.2.*"
Wait a moment after executing the command and wait for the installation to succeed:
When you enter the project after successful installation, you can see the various directories of the framework, including composer.json:
This is the end of this article on "how to install laravel in composer under mac/linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.