【发布时间】:2019-12-07 11:21:38
【问题描述】:
我正在尝试将 Sylius 应用程序部署到 Heroku。构建过程失败并出现以下错误:
...
remote: - Installing doctrine/doctrine-migrations-bundle (2.1.2): Loading from cache
remote: - Installing doctrine/doctrine-fixtures-bundle (v2.4.1): Loading from cache
remote: - Installing sylius/sylius (v1.6.4): Loading from cache
remote: - Installing symfony/dotenv (v4.4.1): Loading from cache
remote: Generating optimized autoload files
remote: ocramius/package-versions: Generating version class...
remote: ocramius/package-versions: ...done generating version class
remote: Executing script cache:clear [KO]
remote: [KO]
remote: Script cache:clear returned with error code 1
remote: !!
remote: !! // Clearing the cache for the prod environment with debug
remote: !! // false
remote: !!
remote: !! PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /tmp/build_f92eb0b1353ebcf9e35e6d53f7853796/vendor/twig/twig/src/Node/Node.php on line 168
remote: !! PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /tmp/build_f92eb0b1353ebcf9e35e6d53f7853796/vendor/composer/ClassLoader.php on line 444
remote: !!
remote: Script @auto-scripts was called via post-install-cmd
remote:
remote: ! ERROR: Dependency installation failed!
remote: !
remote: ! The 'composer install' process failed with an error. The cause
remote: ! may be the download or installation of packages, or a pre- or
remote: ! post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
remote: ! in your 'composer.json'.
remote: !
remote: ! Typical error cases are out-of-date or missing parts of code,
remote: ! timeouts when making external connections, or memory limits.
remote: !
remote: ! Check the above error output closely to determine the cause of
remote: ! the problem, ensure the code you're pushing is functioning
remote: ! properly, and that all local changes are committed correctly.
remote: !
remote: ! For more information on builds for PHP on Heroku, refer to
remote: ! https://devcenter.heroku.com/articles/php-support
remote:
remote: ! Push rejected, failed to compile PHP app.
我已经尝试了 Heroku 文档中建议的所有方法来增加内存限制 https://devcenter.heroku.com/articles/php-concurrency#tuning-concurrency-using-memory_limit
但是建议的方法都没有改变内存限制,它保持在 128M,见错误:Allowed memory size of 134217728 bytes exhausted
将内容为
memory_limit = 256M的 user.init 定位在根文档中。就我而言 /public将 fpm_costum.conf 与内容
php_value[memory_limit] = 256M放在根文档和顶级文件夹中,将 Procfile 更改为:web: heroku-php-apache2 /public -F fpm_custom.conf
我没有想法......
【问题讨论】: