脚本第一行超过PHP最大执行时间

脚本第一行超过PHP最大执行时间,php,cakephp,iis,Php,Cakephp,Iis,我在PHP自己的错误日志中遇到间歇性错误,如下所示: 2015年3月9日09:18:12欧洲/都柏林]PHP致命错误:第27行的C:\inetpub\site\www\index.PHP中超过了120秒的最大执行时间 应用程序在CakePHP上运行,因此index.php只是Cake的普通请求处理程序。对应用程序的每个请求都会通过此文件 该网站在Windows/IIS中的PHP5.4上运行。IIS自己对此特定请求的日志显示这是一个POST请求 这是index.php。第27行是注释之后实际代码的

我在PHP自己的错误日志中遇到间歇性错误,如下所示:

2015年3月9日09:18:12欧洲/都柏林]PHP致命错误:第27行的C:\inetpub\site\www\index.PHP中超过了120秒的最大执行时间

应用程序在CakePHP上运行,因此index.php只是Cake的普通请求处理程序。对应用程序的每个请求都会通过此文件

该网站在Windows/IIS中的PHP5.4上运行。IIS自己对此特定请求的日志显示这是一个POST请求

这是index.php。第27行是注释之后实际代码的第一行,因此可以安全地假设它是PHP尝试在请求上执行的第一行

<?php
/**
 * Requests collector.
 *
 *  This file collects requests if:
 *  - no mod_rewrite is available or .htaccess files are not supported
 *  - requires App.baseUrl to be uncommented in app/Config/core.php
 *  - app/webroot is not set as a document root.
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

/**
 *  Get Cake's root directory
 */
define('APP_DIR', 'app');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__));
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);

/**
 * This only needs to be changed if the "cake" directory is located
 * outside of the distributed structure.
 * Full path to the directory containing "cake". Do not add trailing directory separator
 */
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}

require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';

问题是
max\u input\u time
设置的值太低。只有那些上传大文件的连接速度慢的用户才有这个问题。我在php.ini中增加了
max\u input\u time
,问题就消失了。

出现错误实际上需要120秒吗?此外,您的url重写设置不正确,因为请求至少应重定向到
app/webroot/index.php
。.htaccess文件可能无法在IIS服务器上工作。此外,出于测试目的,您可以尝试在
define('APP_DIR','APP')之前放置一些其他php命令
查看问题是在定义常量还是在任何第一个php命令上实际发生。感谢您的回答,但我最终解决了这个问题-请参阅下文。仅供参考,对于IIS,我们使用重写模块而不是.htaccess。