关于安装composer提示could not open input file composer.phar的问题解决

解决Composer命令执行问题
本文提供了三种解决在使用Composer命令时遇到的问题的方法:1. 使用PHP绝对路径调用composer.phar;2. 将composer.phar复制到当前命令目录;3. 在Windows下直接使用composer命令,避免使用phpcomposer.phar。文章还强调了正确安装和使用Composer的重要性。

查了网上的方法,设置系统环境变量和修改php.ini中的extension=php_openssl都无用

1-要么就用php 绝对路径 \composer.phar

2-要么就把composer.phar拷贝到当前命令目录

3-最简单的方法:windows下直接用composer命令,而不要用php composer.phar

参考如下一段话:

当前目录下面没有composer.phar 默认安装好composer之后这个文件就不要移动或者改名了,用 composer 就能找到对应的路径
如果用php composer.phar 的话除非你用绝对路径引用该文件 比如 "php d:\composer.phar",不然就得把composer.phar复制一份到当前路径了。

[root@yfw ~]# cd /www/wwwroot/yfw.szrengjing.com [root@yfw yfw.szrengjing.com]# ./deploy.sh 🔧 开始自动化部署... fatal: not a git repository (or any of the parent directories): .git fatal: not a git repository (or any of the parent directories): .git No composer.json in current directory, do you want to use the one at /www/wwwroot? [Y,n]? y Always want to use the parent dir? Use "composer config --global use-parent-dir true" to change the default. Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Generating optimized autoload files 1 package you are using is looking for funding. Use the `composer fund` command to find out more! Could not open input file: think Could not open input file: think chown: changing ownership of 'public/.user.ini': Operation not permitted chmod: changing permissions of 'public/.user.ini': Operation not permitted PHP Warning: require(/www/wwwroot/yfw.szrengjing.com/vendor/autoload.php): failed to open stream: No such file or directory in Standard input code on line 2 Warning: require(/www/wwwroot/yfw.szrengjing.com/vendor/autoload.php): failed to open stream: No such file or directory in Standard input code on line 2 PHP Fatal error: require(): Failed opening required '/www/wwwroot/yfw.szrengjing.com/vendor/autoload.php' (include_path='.:') in Standard input code on line 2 Fatal error: require(): Failed opening required '/www/wwwroot/yfw.szrengjing.com/vendor/autoload.php' (include_path='.:') in Standard input code on line 2 Failed to reload php7.4-fpm.service: Unit php7.4-fpm.service not found. 🎉 部署完成 [root@yfw yfw.szrengjing.com]#
最新发布
11-15
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值