PHP警告:file_put_contents(/home/username/.composer/keys.dev.pub):无法打开流:权限被拒绝 - 在线466

时间:2016-06-28 06:36:44

标签: curl composer-php

我需要安装我的sh文件。

我的文件:

#!/bin/bash
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs web/assets/logos
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs web/assets/logos

npm install

curl -sS https://getcomposer.org/installer | php
php composer.phar install
rm composer.phar
php app/console cache:clear --env=dev
php app/console cache:clear --env=prod
php app/console doctrine:database:drop --force
php app/console doctrine:database:create
php app/console doctrine:migrations:migrate --no-interaction
NODE_ENV=production node_modules/.bin/webpack
php app/console assetic:dump --env=prod --no-debug
php app/console assets:install --symlink web

当sh文件步骤:

curl -sS https://getcomposer.org/installer | php

然后显示错误:

All settings correct for using Composer
    PHP Warning:  file_put_contents(/home/ruslan/.composer/keys.dev.pub): failed to open stream: Permission denied in - on line 466
    PHP Warning:  file_put_contents(/home/ruslan/.composer/keys.tags.pub): failed to open stream: Permission denied in - on line 483

我不知道我的卷曲或作曲家会发生什么。请帮帮我。

1 个答案:

答案 0 :(得分:0)

尝试删除主文件夹中的composer目录,然后重新安装:

rm $HOME/.composer -r
curl -s https://getcomposer.org/installer | php
php composer.phar install