在 Laravel 5+ Ubuntu 14.04 上出现 500 内部服务器错误 [英] Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04

查看:26
本文介绍了在 Laravel 5+ Ubuntu 14.04 上出现 500 内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 操作系统上安装了 Laravel 很多次,但从未出现过此类问题.这 500 个内部服务器通常发生在您的mod_rewrite"模块未打开时.

I have installed Laravel many times on Windows OS but it never occurred this type of problem. This 500 internal server usually occurs when your "mod_rewrite" module is not turned on.

然而,在 Ubuntu 14.04 上,这个问题让我很头疼.我已经安装了 rewrite_mod 但它也不起作用.我已授予访问我所有文件夹和文件的权限,即

However, on Ubuntu 14.04 this problem is giving me a headache. I have installed rewrite_mod but it's also not working. I've given access to all my folders and files inside i.e.

/var/www/html/laravel_project

/var/www/html/laravel_project

还是不行..htaccess 也从原来的改成了这个.

Still it doesn't work. Changed .htaccess as well from original to this.

    +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

我也有 Laravel 5+ 所需的所有必要扩展.有没有我没有做的事情?

I have all the necessary extensions needed for Laravel 5+ as well. Is there something left that I didn't do?

推荐答案

终于解决了问题

  • 问题不是 .htaccess 文件,也不是 index.php.问题在于访问文件和需要权限.

为了解决这个问题,我通过终端运行了以下命令.

For solving the problem i ran the following commands through terminal.

sudo chmod -R 755 laravel_blog

然后在下面输入以允许laravel将文件写入存储文件夹

and then type below to allow laravel to write file to storage folder

chmod -R o+w laravel_blog/storage

这两个命令解决了问题.

This two commands solved the problem.

这篇关于在 Laravel 5+ Ubuntu 14.04 上出现 500 内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆