前往官网:
https://getcomposer.org/download/
点击下载:
下载后进行安装:
安装过程中还有配置php的路径:
检验是否安装好:
配置国内镜像:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
项目的根目录创建 composer.json
代码:
写上: "phpoffice/phpexcel": "^1.8"
{
"name": "your/project-name",
"description": "Description of your project",
"require": {
"phpoffice/phpexcel": "^1.8"
},
"autoload": {
"psr-4": {
"YourNamespace\\": "src/"
}
}
}
根据这个json进行安装:
composer install
install好之后出现vendor
最终引入: