在共享主机服务器上上传wesbite时出现500内部错误

时间:2017-03-20 16:46:29

标签: php laravel

我在laravel框架中创建了一个在本地服务器上正常运行的网站,然后我开始在服务器上上传。首先我创建了一个除公共文件之外的所有文件的zip文件,并将其上传到名为&#39的文件夹中; laravel'我在我的cpanel中的主目录中创建并提取内容。之后我做了一个公共的zip并将zip上传到public_html文件夹并解压缩它。然后我将index.php编辑为/../ bootstrap / to / ../laravel/bootstrap在两个地方并保存了..之后我倾倒了数据库,并成功地对.env文件进行了更改。问题是现在有500个内部服务器错误

Internal Server Error

The server encountered an internal error or misconfiguration and was                   unable to complete your request.

 Please contact the server administrator at webmaster@tncpscouriers.com       to inform them of the time this error occurred, and the actions you performed just before this error.

 More information about this error may be available in the server error log.

 Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

最初有一个单页的静态网站,所以我想改变te索引.php再次把它带回来但它仍然不起作用。我现在很无能为力,今天请帮助将项目交给客户的截止日期 我的.htaccess文件是

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

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

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

1 个答案:

答案 0 :(得分:0)

检查文件夹中是否有.env文件

如果不是:

生成.env

cp .env.example .env

生成密钥:

php artisan key:generate

之后,为laravel文件夹提供正确的权限。

输入laravel项目

cd my_project_folder

将644权限添加到文件,将755添加到文件夹:

find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 755 {} \;

如果出现其他错误,请尝试更新您的作曲家

composer update