laravel,基本安装,重定向给我一个500错误

时间:2018-02-28 18:33:06

标签: php laravel laravel-5 vhosts apache2.4

我已经使用composer对Laravel 5.6.5进行了基本的安装,并且我添加了社交网站插件。

我已经阅读了一些stackoverflow问题,但我不能解决它。

如果我使用php artisan serve运行laravel它可以正常工作,但如果我尝试使用本地Apache(2.4.18)它会让我回复此错误:

[Wed Feb 28 19:19:21.079971 2018] [authz_core:debug] [pid 6892] mod_authz_core.c(809): [client 127.0.0.1:35198] AH01626: authorization result of Require all granted: granted
[Wed Feb 28 19:19:21.080019 2018] [authz_core:debug] [pid 6892] mod_authz_core.c(809): [client 127.0.0.1:35198] AH01626: authorization result of <RequireAny>: granted
[Wed Feb 28 19:19:21.080489 2018] [core:error] [pid 6892] [client 127.0.0.1:35198] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Wed Feb 28 19:19:21.080495 2018] [core:debug] [pid 6892] core.c(3628): [client 127.0.0.1:35198] AH00121: r->uri = /public/public/public/public/public/public/public/public/public/public/
[Wed Feb 28 19:19:21.080497 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/public/public/public/public/public/public/
[Wed Feb 28 19:19:21.080499 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/public/public/public/public/public/
[Wed Feb 28 19:19:21.080501 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/public/public/public/public/
[Wed Feb 28 19:19:21.080503 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/public/public/public/
[Wed Feb 28 19:19:21.080504 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/public/public/
[Wed Feb 28 19:19:21.080506 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/public/
[Wed Feb 28 19:19:21.080508 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/public/
[Wed Feb 28 19:19:21.080509 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/public/
[Wed Feb 28 19:19:21.080511 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /public/
[Wed Feb 28 19:19:21.080512 2018] [core:debug] [pid 6892] core.c(3635): [client 127.0.0.1:35198] AH00122: redirected from r->uri = /
[Wed Feb 28 19:19:21.134407 2018] [authz_core:debug] [pid 6894] mod_authz_core.c(809): [client 127.0.0.1:35200] AH01626: authorization result of Require all granted: granted, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134426 2018] [authz_core:debug] [pid 6894] mod_authz_core.c(809): [client 127.0.0.1:35200] AH01626: authorization result of <RequireAny>: granted, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134607 2018] [core:error] [pid 6894] [client 127.0.0.1:35200] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://laravel.local/
[Wed Feb 28 19:19:21.134612 2018] [core:debug] [pid 6894] core.c(3628): [client 127.0.0.1:35200] AH00121: r->uri = /public/public/public/public/public/public/public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134614 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/public/public/public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134616 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/public/public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134618 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134619 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134625 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134627 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134629 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134630 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134632 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /public/favicon.ico, referer: http://laravel.local/
[Wed Feb 28 19:19:21.134634 2018] [core:debug] [pid 6894] core.c(3635): [client 127.0.0.1:35200] AH00122: redirected from r->uri = /favicon.ico, referer: http://laravel.local/

这是我的vhost:

<VirtualHost *:80>
    ServerName laravel.local

    ServerAdmin webmaster@localhost
    DocumentRoot /home/oskar/Webapps/Laravel/twitter_follow/public
        <Directory   /home/oskar/Webapps/Laravel/twitter_follow/public>
        AllowOverride All
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST PUT DELETE OPTIONS>
                        Require all granted
                </Limit>

                <LimitExcept GET POST PUT DELETE OPTIONS>
                        Require all denied
                </LimitExcept>
        </Directory>
    ErrorLog ${APACHE_LOG_DIR}/laravel_local.error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel debug

    CustomLog ${APACHE_LOG_DIR}/laravel_local.access.log combined
</VirtualHost>

这是.htaccess文件:

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

RewriteEngine On

# 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>

知道发生了什么事吗?

感谢。

奥斯卡

1 个答案:

答案 0 :(得分:0)

你可以试试这个vhost吗?通过查看跟踪它可能是一个配置问题

<VirtualHost *:80>
  ServerName laravel.local
  DocumentRoot /home/oskar/Webapps/Laravel/twitter_follow/public

  <Directory /home/oskar/Webapps/Laravel/twitter_follow/public>
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
  </Directory>

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

</VirtualHost>