如何安装Composer
1个回答
展开全部
1设置php.ini,方便安装 在从官网下载Composer-Setup.exe安装程序后,在安装过程中会碰到几个麻烦的地方: 1.找不到扩展dll文件,修改php.ini文件内extension_dir参数 2.browscap未找到,修改php.ini文件内browscap参数 3.SSLdll未找到,修改php.ini文件内";extension=php_openssl.dll",去掉前面“;” 正确的安装画面,如下: 2使用Composer中文镜像网站,替代国外网站 当你安装完Composer后,使用时,缺发现不能下载包,这是一个众所周知的原因。 所以,我们要什么国内的镜像站点进行代替,常用方法有两种: 1.修改全局配置:全局配置的文件一般放在C:\Users\XXX\AppData\Roaming\Composer\config.json; {"config":{},"repositories":[{"type":"composer","url":"/repo/packagist/"},{"packagist":false}]} 2.修改当前配置:即项目当前的composer.json文件; 以laravel项目的composer.json配置文件为例: {"name":"laravel/laravel","description":"TheLaravelFramework.","keywords":["framework","laravel"],"license":"MIT","type":"project","require":{"laravel/framework":"4.2.*"},"autoload":{"classmap":["app/commands","app/controllers","app/models","app/database/migrations","app/database/seeds","app/tests/TestCase.php"]},"scripts":{"post-install-cmd":["phpartisanclear-compiled","phpartisanoptimize"],"post-update-cmd":["phpartisanclear-compiled","phpartisanoptimize"],"post-create-project-cmd":["phpartisankey:generate"]},"config":{"preferred-install":"dist"},"minimum-stability":"stable","repositories":[{"type":"composer","url":"/repo/packagist/"},{"packagist":false}]}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询