magento2: Max execution time of 60 seconds exceeded in CLI

Hi,

I got this error when running php bin/magento setup:static-content:deploy from the CLI. I have to run with -d max_executin_time=0 to avoid the error. This should not happen since PHP CLI has max_execution_time with 0 as default.

IMHO, we shouldn’t define the max_execution_time or call set_time_limit within the code, but let the php.ini values kick in or at least define it in static.php.

root@bad6c70cf905:/var/www# sudo -H -u www-data /usr/bin/php bin/magento setup:static-content:deploy
Requested languages: en_US
=== frontend -> Magento/luma -> en_US ===
........................PHP Fatal error:  Maximum execution time of 60 seconds exceeded in /var/www/vendor/oyejorge/less.php/lib/Less/Parser.php on line 1539
PHP Stack trace:
PHP   1. {main}() /var/www/bin/magento:0
PHP   2. Symfony\Component\Console\Application->run() /var/www/bin/magento:25
PHP   3. Magento\Framework\Console\Cli->doRun() /var/www/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\Console\Application->doRun() /var/www/lib/internal/Magento/Framework/Console/Cli.php:49
PHP   5. Symfony\Component\Console\Application->doRunCommand() /var/www/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   6. Symfony\Component\Console\Command\Command->run() /var/www/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   7. Magento\Deploy\Console\Command\DeployStaticContentCommand->execute() /var/www/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
PHP   8. Magento\Deploy\Model\Deployer->deploy() /var/www/app/code/Magento/Deploy/Console/Command/DeployStaticContentCommand.php:120
PHP   9. Magento\Deploy\Model\Deployer->deployFile() /var/www/app/code/Magento/Deploy/Model/Deployer.php:181
PHP  10. Magento\Framework\App\View\Asset\Publisher->publish() /var/www/app/code/Magento/Deploy/Model/Deployer.php:340
PHP  11. Magento\Framework\App\View\Asset\Publisher->publishAsset() /var/www/lib/internal/Magento/Framework/App/View/Asset/Publisher.php:50
PHP  12. Magento\Framework\View\Asset\File->getSourceFile() /var/www/lib/internal/Magento/Framework/App/View/Asset/Publisher.php:63
PHP  13. Magento\Framework\View\Asset\Source->getFile() /var/www/lib/internal/Magento/Framework/View/Asset/File.php:150
PHP  14. Magento\Framework\View\Asset\Source->preProcess() /var/www/lib/internal/Magento/Framework/View/Asset/Source.php:86
PHP  15. Magento\Framework\View\Asset\PreProcessor\Pool->process() /var/www/lib/internal/Magento/Framework/View/Asset/Source.php:128
PHP  16. Magento\Developer\Model\View\Asset\PreProcessor\PreprocessorStrategy->process() /var/www/lib/internal/Magento/Framework/View/Asset/PreProcessor/Pool.php:74
PHP  17. Magento\Framework\View\Asset\PreProcessor\AlternativeSource->process() /var/www/app/code/Magento/Developer/Model/View/Asset/PreProcessor/PreprocessorStrategy.php:62
PHP  18. Magento\Framework\View\Asset\PreProcessor\AlternativeSource->processContent() /var/www/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php:115
PHP  19. Magento\Framework\Css\PreProcessor\Adapter\Less\Processor->processContent() /var/www/lib/internal/Magento/Framework/View/Asset/PreProcessor/AlternativeSource.php:155
PHP  20. Less_Parser->getCss() /var/www/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php:86
PHP  21. Less_Tree_Ruleset->compile() /var/www/vendor/oyejorge/less.php/lib/Less/Parser.php:187
PHP  22. Less_Tree_Ruleset->PrepareRuleset() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php:70
PHP  23. Less_Tree_Ruleset->evalImports() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php:235
PHP  24. Less_Tree_Import->compile() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php:248
PHP  25. Less_Tree_Import->ParseImport() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Import.php:193
PHP  26. Less_Tree_Ruleset->evalImports() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Import.php:273
PHP  27. Less_Tree_Import->compile() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php:248
PHP  28. Less_Tree_Import->ParseImport() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Import.php:193
PHP  29. Less_Parser->parseFile() /var/www/vendor/oyejorge/less.php/lib/Less/Tree/Import.php:269
PHP  30. Less_Parser->GetRules() /var/www/vendor/oyejorge/less.php/lib/Less/Parser.php:343
PHP  31. Less_Parser->parsePrimary() /var/www/vendor/oyejorge/less.php/lib/Less/Parser.php:532
PHP  32. Less_Parser->MatchFuncs() /var/www/vendor/oyejorge/less.php/lib/Less/Parser.php:860
PHP  33. Less_Parser->parseMixinDefinition() /var/www/vendor/oyejorge/less.php/lib/Less/Parser.php:710

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 24 (15 by maintainers)

Commits related to this issue

Most upvoted comments

We’ve experienced this issue, too. For those who need to work past it for now until the resolution is merged, we’ve manually set $this->max_execution_time = 600; in vendor/tubalmartin/cssmin/cssmin.php (overwriting the hardcoded value of 60).