当前位置:网站首页>[php] composer installation
[php] composer installation
2022-06-22 06:25:00 【wyy7293】
Composer yes PHP A dependency management tool for . We can declare the dependent external tool library in the project ,Composer Will help you install these dependent library files , With it , We can easily use a command to reference other people's excellent code into our project .
Composer Not a global installation by default , Instead, it is based on a directory of the specified project ( for example vendor) Installation .
Composer need PHP 5.3.2+ Above version , And it needs to be turned on openssl.
Composer Can run in Windows 、 Linux as well as OSX On the platform .
install
Linux
- Install with command
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" php composer-setup.php- If the order doesn't work , You can use a browser
https://install.phpcomposer.com/installer- renamed
composer-setup.php- Transmit to the server for execution
php composer-setup.phpdownloadcomposer.phar- Move
composer.phar, such composer You can make a global call
mv composer.phar /usr/local/bin/composer- Switch to domestic image
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
to updatecomposer selfupdate
windows
Wondows On , Need to download Composer-Setup after , Can be installed
Be careful
Need to open openssl To configure , We turn on php In the catalog php.ini, take extension=php_openssl.dll Just remove the semicolon in front of you
After successful installation , We can use the command window (cmd) Input composer --version Command to see if the installation was successful
Change Alibaba cloud image
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
Unconfigure :
composer config -g --unset repos.packagist
Only modify the current engineering configuration , Only the current project can use this image address
composer config repo.packagist composer https://mirrors.aliyun.com/composer/
Unconfigure :
composer config --unset repos.packagist
Have a problem ?
- It is suggested that we should first Composer Upgrade to the latest version :
composer self-update- Execute the diagnostic command
composer diagnose- Clear cache
composer clear- If other sources have been installed , You need to update composer.lock file , Carry out orders
composer update --lock
Mac OS System
Mac OS The system can use the following command to install :
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version
Composer version 1.7.2 2018-08-16 16:57:12
Switch to domestic image :
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
to update composer:
composer selfupdate
边栏推荐
猜你喜欢
随机推荐
Array and foreach traversal in C #
【TP6】使用workerman websocket
Research on dynamics and control of single ball robot
SQL 注入漏洞(十)二次注入
Markdown中插入类图(classDiagram)
What is JUC
878. the nth magic number math + two points
【M32】单片机 svn 设置忽略文件
Shengxin visualization (Part4) -- correlation diagram
高考是人生旅途的一处驿站
[PHP]TP6 CLI模式下创建tp6和多应用配置以及常见问题
[5g NR] RRC connection reconstruction analysis
PgSQL batch insert
【NAND文件系统】UBI介绍
Seven parameters of thread pool and custom thread pool
IO密集型和CPU密集型
drop、truncate和delete的区别
CGIC file upload - rookie notes
CGIC文件上传----菜鸟笔记
Single cell thesis record (part13) -- spagcn: integrating gene expression, spatial location and history to





![[5g NR] ng interface](/img/28/98e545104e4530d0e8f65e9ac993ca.png)




