1

提交 $_POST['form'] 时,如果空闲超过 8 或 9 分钟,我会收到超时错误;它总是在变化。这是错误的屏幕截图:

在此处输入图像描述

这是我在错误日志中得到的:

[Sat Apr 21 20:15:00 2012] [error] [client .......] 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.

这不可能是我的脚本。这是一个非常标准的形式。此外,我在共享主机中拥有的所有 6 个站点上都出现此错误。这是我的 .htaccess 文件...

    Options +FollowSymLinks
    RewriteEngine On

    Options -Multiviews
    RewriteBase /

    RewriteRule ^([a-zA-Z0-9-]+/?)$ $1.php

    #edit forum question -- questions.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^edit/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+) edit.php?question_num=$1&question=$2 [NC]

    #edit forum question id -- questions.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^edit/([a-zA-Z0-9-]+) edit.php?question_num=$1 [NC]

    #usernames -- index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([a-zA-Z0-9-]+) index.php?post=$1 [NC]

问题是任何帖子形式的站点范围。如果您等待很长时间提交,则会发生此超时错误。

我不认为这是 php.ini 的问题。我几乎已经涵盖了所有内容:

register_globals = off
allow_url_fopen = off

expose_php = Off
max_input_time = 18000
max_execution_time = 18000

;extension_dir = ./
upload_tmp_dir = ./tmp

;precision = 12

session.cache_expire = 10080
session.cookie_lifetime = 200000
session.gc_maxlifetime = 10000

memory_limit = 100M
post_max_size = 100M
file_uploads = On
upload_max_filesize = 192M

检出 .htaccess 文件后,您能看到导致此问题的任何原因吗?或者,它是完全不同的东西吗?我还应该注意,我正在使用 cookie 并且没有会话数据。

4

1 回答 1

2

您的 htaccess 中需要一个 L 标志,否则它只会无限循环它们 -

# Important L flag! 
RewriteRule ^([a-zA-Z0-9-]+/?)$ $1.php [L]

#edit forum question -- questions.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^edit/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+) edit.php?question_num=$1&question=$2 [NC,L]

#edit forum question id -- questions.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Important $ dollar sign next line - otherwise it matches above rule
RewriteRule ^edit/([a-zA-Z0-9-]+)$ edit.php?question_num=$1 [NC,L]

#usernames -- index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9-]+) index.php?post=$1 [NC,L]

没有 L 它会重写规则并在重写后再次循环(再次重写)。

于 2012-04-22T07:20:52.540 回答