导入WordPress主题单元测试数据时,无法解决”超出最大执行时间”错误

发生此错误时, 我正尝试导入Wordpress主题单元测试数据, 这让我很生气。

Fatal error: Maximum execution time of 60 seconds exceeded in E:\WebServer\w3programmers\wp-includes\class-http.php on line 1511

我尝试过的事情清单:

  1. 将max_execution_time更改为一个小时!在php.ini中
  2. 更改为无限制(0)
  3. 在我的htaccess文件中更改了它
  4. 尝试在配置文件中使用set_time_limit()进行更改
  5. 尝试使用ini_set()进行更改
  6. 使用此插件尝试过WP超过最大执行时间

没用。我什至尝试使用WP-Cli工具从命令行运行导入。是的, 即使cli也失败, 并出现相同的错误。我通过在配置文件的开头回显ini_get(” max_execution_time”)的返回值进行检查。是的, 它确实输出了我在php.ini和其他地方设置的值。

我认为PHP经过硬编码, 可以在cli中实现无限的执行时间。这是PHP错误吗?还是Wordpress错误?

我在Windows上使用XAMPP。 PHP 5.5.11。


#1


我遇到了同样的问题, 搜索并找到了为我解决的解决方案:WordPress 4.2致命错误–超过60秒的最大执行时间

基本上, 它指示你在脚本错误超时之前的行中添加set_time_limit(1000)或你想在行中添加多少秒, 因此在你的情况下, 将其添加到class-http.php文件的第1510行中。

我知道这是你提出要求后的6个月, 但也许会帮助其他人解决这个问题!


#2


你可能还需要设置

php_value post_max_size xxxM
php_value upload_max_filesize xxxM
php_value memory_limit xxxM
php_value max_execution_time xxxxxx
php_value max_input_time xxxxxx
php_value session.gc_maxlifetime xxxx

所以在.htaccess中, 如果启用了.htaccess阅读功能,

<IfModule mod_php5.c>
php_value post_max_size 000M
php_value upload_max_filesize 000M
php_value memory_limit 000M
php_value max_execution_time 000000
php_value max_input_time 000000
php_value session.gc_maxlifetime 0000
</IfModule>

#3


通过更改wp-includes / deprecated.php中wp_get_http()内的set_time_limit调用, 我对此感到很高兴:

set_time_limit(1200); // Limit to 20 minutes

错误的更多信息在这里。

来源:

https://www.srcmini02.com/66970.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_36990.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?