cd 到一个空文件夹,然后执行composer require workerman/workerman出现错误

liushiwkmphp

我是按照手册上的操作,cd /usr/local/workerm/wmProject/test1
然后执行 composer require workerman/workerman
出现如下错误:
In RequireCommand.php line 133:
file_put_contents(./composer.json): failed to open stream: Permission denied
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

1023 1 0
1个回答

manbuheiniu

file_put_contents(./composer.json): failed to open stream: Permission denied
当前用户对目录没有写权限。建议添加权限后再试

  • liushiwkmphp 2022-04-26

    是给目录添加写权限,还是给./composer.json文件添加写权限?chmod 755 /usr/local/workerm 这样操作还是错误

年代过于久远,无法发表回答
×
🔝