laravel 完成将文件上传到服务器 laravel5 后的空白页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32709840/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:23:06  来源:igfitidea点击:

Blank white page when finished uploading files to server laravel5

laravellaravel-5hosting

提问by Ranjeet Karki

I have finished uploading files to server inside demofolder, but when i visited i got blank white page. when i visited somedomain.com/demoi got blank white page. Can anyone help me please. My folder directory start with demo. Inside demofolder i have app,bootstrap,configetc folders. when i view storage/log file i got

我已经完成将文件上传到demo文件夹内的服务器,但是当我访问时,我得到了空白的白页。当我访问时,somedomain.com/demo我得到了空白的白页。任何人都可以帮助我。我的文件夹目录以demo开头。里面demo的文件夹我有appbootstrapconfig等文件夹。当我查看存储/日志文件时

[2015-09-20 06:38:00] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}  
[2015-09-20 06:52:16] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}  
[2015-09-20 06:53:23] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}  
[2015-09-20 06:58:28] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Foundation\Application::getCachedCompilePath()' in C:\xampp\htdocs\sidinsu\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\ClearCompiledCommand.php:28
Stack trace:
#0 {main}  

回答by James

The blank page suggests a 500 error and your logs back this up.

空白页面提示 500 错误,您的日志对此进行了备份。

Looking at your logs it is an issue with the vendor/compiled.phpfile.

查看您的日志,这是vendor/compiled.php文件的问题。

Just delete this file, run composer update, and then php artisan optimizeafter the update to rebuild compiled.php.

删除这个文件,运行composer update,然后php artisan optimize更新后重建即可compiled.php

On a side note, the URL to view this should be somedomain.com/demo/public as this is where the index.phpfile is located - unless you have already dealt to this.

附带说明一下,查看此index.php文件的 URL 应为 somedomain.com/demo/public,因为这是文件所在的位置 - 除非您已经处理过此问题。

回答by Alexander Nicholas Popa

When you move Laravel 5 to a production server please do the following:

当您将 Laravel 5 移至生产服务器时,请执行以下操作:

Change permissions of storage and bootstrap folders to 0755 or 0777 chmod -R 0777 storage/composer install composer update artisan cache:clear

将存储和引导文件夹的权限更改为 0755 或 0777 chmod -R 0777 storage/composer install composer update artisan cache:clear

This will resolve your dependencies and make laravel functional. When you get packages conflicts after doing the above steps remove the packages from app/config/app.php and delete their folders from vendor and run composer update.

这将解决您的依赖关系并使 laravel 正常运行。当您在执行上述步骤后遇到包冲突时,从 app/config/app.php 中删除包并从供应商中删除它们的文件夹并运行 composer update。

Also make sure you will meet Laravel 5 minimum requirements. PHP 5.5.9 is required.

还要确保您满足 Laravel 5 的最低要求。需要 PHP 5.5.9。