我在Laravel编码方面遇到问题,我在cPanel上运行了我的项目。我遇到了如下所示的错误:
http://tinypic.com/view.php?pic=maw4kz&s=9#.Wpb6ZHyYPIU][1]
file_put_contents(/Ik8QAmCPtQ3uAwA8CrWuXj5er6l4wkmonsFTirKy): failed to open stream: Permission denied
in Filesystem.php (line 122)
at HandleExceptions->handleError(2, 'file_put_contents(/Ik8QAmCPtQ3uAwA8CrWuXj5er6l4wkmonsFTirKy): failed to open stream: Permission denied', '/home/webgraph/laravel/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php', 122, array('path' => '/Ik8QAmCPtQ3uAwA8CrWuXj5er6l4wkmonsFTirKy', 'contents' => 'a:3:{s:6:"_token";s:40:"95GMZ8vTLxeX4QlFh7gKXrD23xp8HtSGvBxn20i4";s:9:"_previous";a:1:{s:3:"url";s:19:"http://webgraph.net";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 'lock' => true))
at file_put_contents('/Ik8QAmCPtQ3uAwA8CrWuXj5er6l4wkmonsFTirKy', 'a:3:{s:6:"_token";s:40:"95GMZ8vTLxeX4QlFh7gKXrD23xp8HtSGvBxn20i4";s:9:"_previous";a:1:{s:3:"url";s:19:"http://webgraph.net";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 2)
in Filesystem.php (line 122)
at Filesystem->put('/Ik8QAmCPtQ3uAwA8CrWuXj5er6l4wkmonsFTirKy', 'a:3:{s:6:"_token";s:40:"95GMZ8vTLxeX4QlFh7gKXrD23xp8HtSGvBxn20i4";s:9:"_previous";a:1:{s:3:"url";s:19:"http://webgraph.net";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', true)
in FileSessionHandler.php (line 83)
at FileSessionHandler->write('Ik8QAmCPtQ3uAwA8CrWuXj5er6l4wkmonsFTirKy', 'a:3:{s:6:"_token";s:40:"95GMZ8vTLxeX4QlFh7gKXrD23xp8HtSGvBxn20i4";s:9:"_previous";a:1:{s:3:"url";s:19:"http://webgraph.net";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}')
in Store.php (line 129)
at Store->save()
in StartSession.php (line 88)
at StartSession->terminate(object(Request), object(Response))
in Kernel.php (line 218)
at Kernel->terminateMiddleware(object(Request), object(Response))
in Kernel.php (line 189)
at Kernel->terminate(object(Request), object(Response))
in index.php (line 58)
我检查了所有权限,并将我的所有文件夹(例如存储和供应商)设置为cpanel上的777权限,但不幸的是它没有用,我搜索了很多。如果有人指导我,我将不胜感激。
答案 0 :(得分:0)
您可以使用public_path() / app_path() / storage_path()
等目录功能来保存文件
如果您在首次运行时遇到此错误,请检查您的存储文件夹。你应该有 app 和框架文件夹