Composer(PHP依赖管理工具)安装
2014-12-26 17:36
621 查看
http://docs.phpcomposer.com/00-intro.md#Installation-*nix
切换到项目目录。增加文件:
[root@localhost html]# vi composer.json
{
"require": {
"monolog/monolog": "1.0.*"
}
}
由于composer是安装在/root下的,所以在项目下,我们这样执行:
[root@localhost html]# php /root/composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing monolog/monolog (1.0.2)
Loading from cache
Writing lock file
Generating autoload files
项目文件a.php中可以增加这行语句,进行自动加载composer下载的包类:
[root@localhost html]# vi /var/www/html/a.php
<?php
require 'vendor/autoload.php';
切换到项目目录。增加文件:
[root@localhost html]# vi composer.json
{
"require": {
"monolog/monolog": "1.0.*"
}
}
由于composer是安装在/root下的,所以在项目下,我们这样执行:
[root@localhost html]# php /root/composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing monolog/monolog (1.0.2)
Loading from cache
Writing lock file
Generating autoload files
项目文件a.php中可以增加这行语句,进行自动加载composer下载的包类:
[root@localhost html]# vi /var/www/html/a.php
<?php
require 'vendor/autoload.php';
相关文章推荐
- Mac下PHP依赖管理工具Composer下载与安装
- PHP Lumen框架 和 Composer依赖管理工具 安装笔记
- Mac下PHP依赖管理工具Composer下载与安装
- Mac下PHP依赖管理工具Composer下载与安装
- Mac下PHP依赖管理工具Composer下载与安装
- Mac下PHP依赖管理工具Composer下载与安装
- php依赖管理工具Composer的安装和使用
- PHP管理依赖(dependency)关系工具 Composer 安装与使用
- Mac下PHP依赖管理工具Composer下载与安装
- Mac下PHP依赖管理工具Composer下载与安装
- ubuntu上使用PHP依赖管理工具Composer(一)——安装
- windows下安装php依赖关系管理工具composer
- Mac下PHP依赖管理工具Composer下载与安装
- 使用PHP依赖管理工具Composer安装Guzzle
- PHP管理依赖(dependency)关系工具 Composer 安装与使用
- PHP依赖管理工具composer安装和使用
- Composer 是 PHP 的依赖管理工具----安装
- Mac下PHP依赖管理工具Composer下载与安装
- Mac下PHP依赖管理工具Composer下载与安装
- Mac下PHP依赖管理工具Composer下载与安装