工匠修补匠:mkdir()权限被拒绝 [英] artisan tinker: mkdir() permission denied
问题描述
Laravel 5.0.33版
Laravel Version 5.0.33
> php artisan tinker
[ErrorException]
mkdir(): Permission denied
这是在生产服务器上,我正尝试使用tinker作为Web用户来测试命令.该用户拥有基本路径中的每个目录,因此我不确定在运行artisan tinker时会尝试创建哪个目录.
This is on a production server, I was trying to test a command with tinker as the web user. This user owns every directory in the base path, so I'm not sure what directory is attempted to be created when I run artisan tinker.
推荐答案
使用非常详细的-vvv
,我可以获取堆栈跟踪.
Using very verbose -vvv
, I was able to get a stack trace.
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,但没有对该文件夹的执行权限.
getHistoryFile() attempts to create a file in the user home directory, not the application directory. This user's home was set to /var/www/html but it didn't have execute permissions on that folder.
这篇关于工匠修补匠:mkdir()权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!