PHPStorm laravel 个问题

PHPStorm laravel issues

我在让 PHPStorm 与 laravel/composer 一起工作时遇到了一些麻烦。

打开 PHPStorm 后,我创建了一个新的 Composer 项目:http://puu.sh/e4y1H/6fb97cf976.png

之后,我填写了必要的详细信息:http://puu.sh/e4y6Z/55bc60e7fc.png

继续后,我遇到了以下错误:

php /Users/mdobrenko/Sites/test/composer.phar create-project laravel/laravel 
/Users/mdobrenko/Sites/test/composer -n --no-progress
Installing laravel/laravel (v4.2.11)
  - Installing laravel/laravel (v4.2.11)
    Loading from cache

Created project in /Users/mdobrenko/Sites/test/composer
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing symfony/translation (v2.5.8)
    Loading from cache

  - Installing symfony/security-core (v2.5.8)
    Loading from cache

  - Installing symfony/routing (v2.5.8)
    Loading from cache

  - Installing symfony/process (v2.5.8)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing symfony/debug (v2.5.8)
    Downloading: connection...    Downloading: 0%               Downloading: 10%    Downloading: 35%    Downloading: 45%    Downloading: 70%    Downloading: 80%    Downloading: 90%    Downloading: 100%

  - Installing symfony/http-foundation (v2.5.8)



  [ErrorException]                          
  touch(): Utime failed: 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]

我存储我的开发项目的 'Sites' 目录,也就是这个项目所在的目录,设置了以下权限:

drwxrwxrwx   11 mdobrenko  staff   374 Jan  4 13:40 Sites

我注意到我的大多数 php artisan 命令都需要使用 'sudo'。通过命令创建一个新的 laravel 项目:

composer create-project laravel/laravel your-project-name --prefer-dist

我感觉权限可能是问题所在,但我不确定如何解决这个问题。任何帮助将不胜感激!

link 应该有所帮助。尝试清除 composer 缓存,重新安装 composer,将 Sites 文件夹更改为与 apache 服务器使用相同的用户

要清除作曲家缓存,请打开终端并 cd 进入您的项目文件夹:sudo composer clear-cache(此处可能不需要 sudo)

更改权限:chown -R $(whoami): . 这会将所有文件和子目录的所有者设置为当前用户。授予您访问这些文件的权限。