首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何给eDirectory/Symfony 2.8更多的时间?错误:超过最大执行时间60秒

问如何给eDirectory/Symfony 2.8更多的时间?错误:超过最大执行时间60秒
EN

Stack Overflow用户
提问于 2018-07-21 01:20:50
回答 1查看 76关注 0票数 0

我将max_execution_time设置为120秒。

代码语言:javascript
复制
$ grep max_execution_time /etc/php5/php.ini
max_execution_time = 120

我仍然收到这个错误

代码语言:javascript
复制
Error: Maximum execution time of 60 seconds exceeded

在几次重新加载之后,它将工作(假设它正在编译Twig和更少的内容到缓存),但它经常失败,特别是对于新页面或在运行composer之后。

我看不到任何地方是通过代码设置(更低)的:

代码语言:javascript
复制
$ grep -r max_execution_time *
vendor/symfony/symfony/appveyor.yml:    - echo max_execution_time=1200 >> php.ini-min
web/classes/phpmailer/class.smtp.php:            $max = ini_get('max_execution_time');
web/conf/phpini.inc.php:    ini_set("max_execution_time", "3600");
web/simplesaml/modules/statistics/config-templates/module_statistics.php:        * Set max running time for this script. This is also controlle by max_execution_time in php.ini

我也尝试添加opcache来加快速度,但它似乎并不快。

代码语言:javascript
复制
$ grep opcache composer.json
        "ext-opcache": "*",

$ cat /etc/php5/conf.d/opcache.ini
zend_extension = /usr/lib/php/20131226/opcache.dll
; Sets how much memory to use
opcache.memory_consumption=128

;Sets how much memory should be used by OPcache for storing internal strings
;(e.g. classnames and the files they are contained in)
opcache.interned_strings_buffer=8

; The maximum number of files OPcache will cache
opcache.max_accelerated_files=4000

;How often (in seconds) to check file timestamps for changes to the shared
;memory storage allocation.
opcache.revalidate_freq=60

;If enabled, a fast shutdown sequence is used for the accelerated code
;The fast shutdown sequence doesn't free each allocated block, but lets
;the Zend Engine Memory Manager do the work.
opcache.fast_shutdown=1

;Enables the OPcache for the CLI version of PHP.
opcache.enable_cli=1

;If you use any library or code that uses code annotations you must enable save comments:
opcache.save_comments=1

Symfony 2.8,PHP 5.6.27

EN

回答 1

Stack Overflow用户

发布于 2018-07-21 02:13:53

我添加了

代码语言:javascript
复制
ini_set("max_execution_time", 120);

在它做很多事情之前,先在第23行执行edirectory\web\app_dev.php。

正如上面的评论中所提到的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51447543

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档