首页 > 解决方案 > 子域内部服务器错误上的 laravel 5.6 此外,遇到 500 内部服务器错误错误

问题描述

它不会向错误日志写入任何内容!

我有一个指向托管 laravel 应用程序的服务器 IP 的子域。

主页运行良好(subdomain.domain.com)并显示 laravel 徽标。

我添加到 URL 的任何其他内容都会显示此错误。

例如: subdomain.domain.com/test 显示此错误:

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

Please contact the server administrator, cgiadmin@yourhostingaccount.com and inform them of the time the error occurred, and anything you might have done that may have caused the 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.

我正在使用 apache 虚拟主机来处理请求,它看起来像这样:

<VirtualHost *:80>
        ServerName subdomain.domain.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/mysite/public/

        <Directory /var/www/mysite/public/>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
        CustomLog ${APACHE_LOG_DIR}/mysite-access.log combined

</VirtualHost>

这是公用文件夹中的 .htaccess

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

    RewriteEngine On

    RewriteBase /
    # 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]
</IfModule>

默认的错误日志文件和我在虚拟主机中指定的都是空的。

当我直接使用IP时,它工作正常。所以http://123.123.123.123/test有效。

标签: phplaravelapache.htaccesssubdomain

解决方案


推荐阅读