我已经将 Laravel 5.1 项目转换为 Laravel 4.2,因为它需要在 PHP 5.4 上运行。 一切正常,只是项目正在寻找宿主机根目录下的 services.json 文件。 我可以在根目录中创建这个文件,给它权限,然后项目运行。但我认为这不是 services.json 文件应该放在的正确位置。由于我无法访问我服务器上的根目录,这个问题仍然存在。 在本地主机上,如果我运行 php artisan serve 并停止它,json 文件将在根目录中创建。但我仍然认为这是错误的地方。
我创建了一个普通的 Laravel 4.2 项目来查看差异,但我找不到任何差异。
有没有可能让 Laravel 把这个文件放到项目的根目录下?
我很高兴得到所有答案。
谢谢
Error message:
ErrorException (E_WARNING)
HELP
Callstack information; navigate with mouse or keyboard using Ctrl+↑ or Ctrl+↓
Copy-to-clipboard button
Exception message and its type
Code snippet where the error was thrown
Server state information
Application provided context information
ErrorException thrown with message "file_put_contents(/services.json): failed to open stream: Permission denied" Stacktrace: #8 ErrorException in /home/project/staging/bootstrap/compiled.php:4000 #7 Illuminate\Exception\Handler:handleError in <#unknown>:0 #6 file_put_contents in /home/project/staging/bootstrap/compiled.php:4000 #5 Illuminate\Filesystem\Filesystem:put in /home/project/staging/bootstrap/compiled.php:4279 #4 Illuminate\Foundation\ProviderRepository:writeManifest in /home/project/staging/bootstrap/compiled.php:4258 #3 Illuminate\Foundation\ProviderRepository:compileManifest in /home/project/staging/bootstrap/compiled.php:4222 #2 Illuminate\Foundation\ProviderRepository:load in /home/project/staging/vendor/laravel/framework/src/Illuminate/Foundation/start.php:210 #1 require in /home/project/staging/bootstrap/start.php:60 #0 require_once in /home/project/staging/public/index.php:35
file_put_contents(/services.json): failed to open stream: Permission denied
open: /home/project/staging/bootstrap/compiled.php
最佳答案
显然,当我将项目从 Laravel 5 转换为 4.2 时,我漏掉了一行。
app/config/app.php
,未设置 list :
'manifest' => storage_path().'/meta',
关于php - Laravel 4.2 services.json 文件在主机的根目录下创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32588314/