您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
使用php7.3.4与composer安装workerman及composer指定php.ini
发布时间:2021-11-27 13:39:27编辑:雪饮阅读()
安装workerman时候,我用我的linux虚拟机的环境进行安装,其php版本是7.3.4.
可能是编译时候对php.ini的相关处理没有做到位,则不会自动加载php.ini,我需要用如php -c /usr/local/php734/lib/php/php.ini这样的方式。
那么composer安装workerman时候怀疑就是因为没有正确加载到php.ini才导致提示我一个openssl扩展没有安装,我记忆中我是安装了的。
那么查看composer的帮助信息,其中有个-c的参数查看其介绍是说可以指定加载php.ini或者从一个指定的php.ini的目录查询php.ini。
本人尝试了不行,最后发现要这样使用必须在composer命令之前补上php命令,也就是说compoer要做为php的命令的参数的形式,如:
[root@localhost workerman]# php -c /usr/local/php734/lib/php/php.ini /usr/local/bin/composer require workerman/workerman
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Using version ^4.0 for workerman/workerman
./composer.json has been updated
Running composer update workerman/workerman
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking workerman/workerman (v4.0.22)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading workerman/workerman (v4.0.22)
- Installing workerman/workerman (v4.0.22): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
这样就将workerman安装好了,但是这里需要注意下,这里composer做为参数就必须是composer命令的绝对路径,即便你有环境变量配置。
关键字词:php7.3.4,composer,workerman,php.ini