本地测试PHP生成二维码的测试,需要使用到第三方库,使用composer安装
composer使用菜鸟教程 https://www.runoob.com/w3cnote/composer-install-and-usage.html
windows10下面安装composer
直接下载composer安装程序 : https://www.runoob.com/w3cnote/composer-install-and-usage.html
-composer win下安装:()ol
-
cd C:in
php -r "readfile('https://getcomposer.org/installer');" | php -
新建文件: composer.bat
echo @php "%~dp0composer.phar" %*>composer.bat -
设置环境变量 C:in
composer -v -
设置国内镜像源
composer config repo.packagist composer https://packagist.phpcomposer.com
composer.json 文件中会多如下配置:
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
以上安装在C盘下面是没有问题的,但是在D盘下面没有composer 这个命令 ,这个咋整了?
目前只能在D盘在安装一次了,设置D盘composer的环境变量了。
设置阿里云 composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
设置其它源 https://segmentfault.com/a/1190000019651993
linux下安装composer
- php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
- php composer-setup.php
- mv composer.phar /usr/local/bin/composer
- 全局安装源: composer config -g repo.packagist composer https://packagist.phpcomposer.com
- 项目下安装源: composer config repo.packagist composer https://packagist.phpcomposer.com
root用户运行提示
Do not run Composer as root/super suer ! See https://getcomposer.org/root
composer 版本号前置~与^符号的区别
-
两位版本号x.y情况下 ~ ^ 没有区别
大于等于 x.y ,小于(x+1).0 -
三位版本号情况下
~1.2.3 代表:大于等于1.2.3 小于 1.3.0
- ^1.2.3 代表 :大于1.2.3 小于 2.0.0
- 代表次版本号
^ 代表主版本号
参考: https://www.cnblogs.com/hcpzhe/p/7909651.html
安装版本 指定具体的版本号
composer require tymon/jwt-auth
composer update tymon/jwt-auth:1.0.1
composer require tymon/jwt-auth:1.0.*
composer remove tymon/jwt-auth
composer require tymon/jwt-auth "1.0."
composer require tymon/jwt-auth "1.0."
JWT json web auth
https://www.cnblogs.com/liwei-17/p/9249546.html
php生成二维码
http://phpqrcode.sourceforge.net/
http://www.phpernote.com/php-function/638.html
https://segmentfault.com/a/1190000013188314