简体   繁体   English

将Laravel项目上传到共享主机时出现奇怪的问题

[英]Strange issue when uploading a Laravel project to shared hosting

I have created a Laravel 2 project and uploaded it to a web host, but the website gives a 500 error. 我创建了一个Laravel 2项目,并将其上传到网络主机,但该网站显示500错误。 I have given 777 permmisions to storge and subfolders. 我为存储和子文件夹提供了777个permmision。 I cleared the views cache but that didn't solve the problem. 我清除了视图缓存,但没有解决问题。

I want to know, why is this problem occurring? 我想知道为什么会出现这个问题? the error 错误

the public/.htacess file Options -MultiViews public / .htacess文件选项-MultiViews

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}]

Could be a number of issues. 可能有许多问题。 Check the following: 检查以下内容:

  1. Have you run composer install to install the vendor files required for Laravel to run? 您是否运行过composer install来安装Laravel运行所需的供应商文件?
  2. Run chmod -R 777 storage (as you have already tried) 运行chmod -R 777 storage (已尝试)
  3. Run chmod -R 777 bootstrap/cache 运行chmod -R 777 bootstrap/cache

Hopefully these steps will help you resolve the issue. 希望这些步骤可以帮助您解决问题。 If you still have issues, see if you can locate the error_log file on your server and see if it points to the issue. 如果仍然有问题,请查看是否可以在服务器上找到error_log文件,并查看它是否指向问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM