Laravel 5 服务器错误 500 在 cpanel 重新发布中托管

Laravel 5 Server Error 500 Hosting in cpanel repost

我昨天 here 发布了一个关于在 Cpanel 中托管 laravel 项目的问题。

我已经尝试了几个与此问题相关的主题中提出的所有解决方案,但仍然出现相同的错误。

很抱歉重新发布这篇文章只是为了获得其他建议和建议,也许我在不合适的时间发布了我的问题。

如果您认为问题可能出在其他地方,我可以发布您想要的任何文件的内容。

检查下面的屏幕截图将 server.php 重命名为 index.php 并取出所有 public 文件夹文件 我标记了需要对其采取操作的文件夹和文件

在public除了index.php取出所有file/folder

打开 .htaccess 文件后,它会出现在您的主文件夹 MyLaravelApp 中,如果没有,则只需创建一个新文件,然后在下面进行应用程序更正

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


    RewriteEngine On

    RewriteCond %{SERVER_PORT} 80
    RewriteCond %{REQUEST_URI} MyLaravelApp(folder name)
    RewriteRule ^(.*)$ https://example.com/MyLaravelApp(folder name)/ [R,L]

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

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

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

    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
    Header set Access-Control-Max-Age "1000"
    Header set Access-Control-Allow-Headers "access_token, x-requested-with, Content-Type, Accept-Encoding, Accept-Language, Cookie, Referer"
</IfModule>

这对我有用,希望对你也有用。