我可以使用composer安装laravel 5.0,没有任何问题。但是当我尝试安装laravel 5.1时,我得到了许可被拒绝。
如果我跑步,这就是我得到的:
composer create-project laravel/laravel MyProjectName
Installing laravel/laravel (v5.1.4)
- Installing laravel/laravel (v5.1.4)
Loading from cache
Created project in schoollege
> php -r "copy('.env.example', '.env');"
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing vlucas/phpdotenv (v1.1.1)
Loading from cache
- Installing symfony/var-dumper (v2.7.3)
Loading from cache
- Installing symfony/translation (v2.7.3)
Loading from cache
- Installing symfony/routing (v2.7.3)
Loading from cache
- Installing symfony/process (v2.7.3)
Loading from cache
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/debug (v2.7.3)
Loading from cache
- Installing symfony/http-foundation (v2.7.3)
Loading from cache
- Installing symfony/event-dispatcher (v2.7.3)
Loading from cache
- Installing symfony/http-kernel (v2.7.3)
Loading from cache
- Installing symfony/finder (v2.7.3)
Loading from cache
- Installing symfony/dom-crawler (v2.7.3)
Downloading: 100%
[ErrorException]
copy(/home/myusername/.composer/cache/files/symfony/dom-crawler/9dabece63182e95c42b06967a0d929a5df78bc35.zip): failed to open stream: Permission denied
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [package] [directory] [version]
我在/var/www/html
文件夹中执行此操作。 /var/www
组中已列出www-data
文件夹,www-data
拥有drwxrwxr-x
我试过的解决方案,但没有一个有效:
可能出现什么问题?
P.S:我在Ubuntu 14.04 LTS x64位架构上使用LAMP。
答案 0 :(得分:0)
由于作曲家在“拒绝许可”时已经过了一半,你需要在遵循Rafael的指示之前清除缓存:
php artisan cache:clear
composer dump-autoload
(来自https://stackoverflow.com/a/24369509/1627732)
然后执行:
sudo useradd -g www-data yourusername
答案 1 :(得分:0)
我的问题和你一样...... 复制(/home/user_name/.composer/cache/files/vlucas/phpdotenv/无法打开流:laravel中的权限被拒绝
我认为我们遇到了 /home/user_name/.composer
的目录权限问题在运行以下命令后,我能够成功创建项目。.
sudo chown -R user_name /home/user_name/.composer/
答案 2 :(得分:0)
我在Mac上也遇到了同样的问题,请运行以下命令: