当前位置:  开发笔记 > 编程语言 > 正文

工匠修补匠:mkdir()许可被拒绝

如何解决《工匠修补匠:mkdir()许可被拒绝》经验,为你挑选了2个好方法。

Laravel版本5.0.33

> php artisan tinker

  [ErrorException]            
  mkdir(): Permission denied  

这是在生产服务器上,我试图用修补程序测试一个命令作为Web用户.这个用户拥有基本路径中的每个目录,因此我不确定在运行artisan tinker时是否尝试创建了哪个目录.



1> Devon..:

使用非常详细-vvv,我能够获得堆栈跟踪.

Exception trace:
 () at /data1/vhosts/admin.stewartcoopercoon.com/vendor/psy/psysh/src/Psy/Configuration.php:459
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at n/a:n/a
 mkdir() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/psy/psysh/src/Psy/Configuration.php:459
 Psy\Configuration->getHistoryFile() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/psy/psysh/src/Psy/Configuration.php:598
 Psy\Configuration->getReadline() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/psy/psysh/src/Psy/Shell.php:78
 Psy\Shell->__construct() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/TinkerCommand.php:51
 Illuminate\Foundation\Console\TinkerCommand->fire() at n/a:n/a
 call_user_func_array() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:526
 Illuminate\Container\Container->call() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/laravel/framework/src/Illuminate/Console/Command.php:115
 Illuminate\Console\Command->execute() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/laravel/framework/src/Illuminate/Console/Command.php:101
 Illuminate\Console\Command->run() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /data1/vhosts/admin.stewartcoopercoon.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:94
 Illuminate\Foundation\Console\Kernel->handle() at /data1/vhosts/admin.stewartcoopercoon.com/artisan:36

getHistoryFile()尝试在用户主目录中创建文件,而不是应用程序目录.此用户的主页设置为/ var/www/html,但它没有该文件夹的执行权限.



2> Bdwey..:

将.psysh.php与此内容一起放在Laravel项目的根目录中

 './.psysh',
    ];

更多信息 https://github.com/laravel/tinker/issues/34#issuecomment-357550126

推荐阅读
虎仔球妈_459
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有