composer 安装教程
邓士鹏
1.先检查php.ini是否开启ssl
;extension=php_openssl.dll
2.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
(修改完composere.json后,必须先更新composer update)
1.配置环境变量:D:\phpStudy\PHPTutorial\php\php-7.2.1-nts (不懂的私聊qq:1215551519)
2.
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" (下载安装脚本 - composer-setup.php - 到当前目录。)
php composer-setup.php (执行安装过程。)
php -r "unlink('composer-setup.php');"
(删除安装脚本。)
https://pkg.phpcomposer.com/#how-to-install-composer
@php "%~dp0composer.phar" %*
------------------------------------------------------------
Packagist 镜像使用方法
还没安装 Composer 吗?请往下看如何安装 Composer 。
composer -v
https://pkg.phpcomposer.com/
https://docs.golaravel.com/docs/5.0/installation/
------------------------------------------------------------------------------------------------------------------------------------------------------------------
方法一: 修改 composer 的全局配置文件(推荐方式)
打开命令行窗口(windows用户)或控制台(Linux、Mac 用户)并执行如下命令:口+R->cmd
复制:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
----------------------------------------------------------------------------------------------------------------------------------------
安装 Laravel
通过 Laravel 安装工具
首先,使用 Composer 下载 Laravel 安装包:
composer global require "laravel/installer=~1.1"
建议大家装好composer后 直接用phpstrom 创建一个新项目然后在它下面的Terminal控制台上输入 composer create-project laravel/laravel –prefer-dist my_laravel my_laravel为要创建的项目名字
装好后再输入php -S localhost:80 -t my_laravel/public 本地80端口就直接可以访问了
安装tp
已安装完成,
代码自己去:官方手册查询
composer config -g repo.packagist composer https://packagist.laravel-china.org
composer create-project topthink/think tp5