php 当语法错误给出错误 500 时?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35971693/
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-08-26 00:38:29  来源:igfitidea点击:

When a syntax error gives the error 500?

phpapachelaravellaravel-4laravel-5.2

提问by MegaWm

The lav52.dev page isn't working lav52.dev is currently unable to handle this request. 500 laraver 5.2 ubuntu 14.04 php 5.6 lamp-server

lav52.dev 页面不工作 lav52.dev 当前无法处理此请求。500 laraver 5.2 ubuntu 14.04 php 5.6 灯服务器

Route::get('/','TestController@index');

class TestController extends Controller
{
 function index()
    {
        echo "index" // I do not have a ;

    }
}

回答by Alexey Mezenin

You should set up apache's DocumentRootto a publicdirectory which is inside root Laravel project directory. I'm pretty sure you've set up it to a root directory, bot public, that's why you're getting 500 error.

您应该将 apache 设置DocumentRootpublicLaravel 项目根目录中的目录。我很确定您已将其设置到根目录 bot public,这就是您收到 500 错误的原因。

回答by Faris Rayhan

Another solution could be your database thing. I use MAMP on my local as server. Once i add new data to my table then my server breaks. Then i was thinking something error in my table structure. I recreate it and it works.

另一个解决方案可能是您的数据库问题。我在本地使用 MAMP 作为服务器。一旦我将新数据添加到我的表中,我的服务器就会中断。然后我在想我的表结构有什么错误。我重新创建它并且它有效。

回答by Subha Sundar Das

Did you give your tmp folder 777 permission?

你给你的 tmp 文件夹 777 权限了吗?

Give permission to Storage folder to 777 and run the command 'php artisan optimize' in your app's directory

将存储文件夹的权限授予 777 并在您的应用程序目录中运行命令“php artisan optimize”