drot98385 2018-07-20 17:20
浏览 46

如何为eDirectory / Symfony 2.8提供更多时间? 错误:超出最大执行时间60秒

I set max_execution_time to 120 seconds.

$ grep max_execution_time /etc/php5/php.ini
max_execution_time = 120

I'm still getting the error

Error: Maximum execution time of 60 seconds exceeded

After several reloads, it will work (presumably it is compiling Twig and LESS to cache), but often it fails, especially for new pages or after running composer.

I don't see anywhere that it is set (lower) via code:

$ 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

I also tried to add opcache to speed it up, but it doesn't seem faster.

$ 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

  • 写回答

1条回答 默认 最新

  • drmqzb5063 2018-07-20 18:13
    关注

    I added

    ini_set("max_execution_time", 120);
    

    to edirectory\web\app_dev.php around line 23 before it does much of anything.

    As mentioned in the comments above.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看