php - 处理 symfony-scripts 事件的脚本 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache 因异常而终止
问题描述
Heroku 日志:
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Creating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
In AbstractMySQLDriver.php line 103:
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 47:
SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 43:
SQLSTATE[HY000] [2002] Connection refused
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
In AbstractMySQLDriver.php line 103:
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 47:
SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 43:
SQLSTATE[HY000] [2002] Connection refused
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
! Push rejected, failed to compile PHP app.
! Push failed
处理 symfony-scripts 事件的脚本 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache 因异常而终止
[运行时异常]
执行“'cache:clear --no-warmup'”命令时出错
作曲家.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": { "Tests\\": "tests/" },
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"easycorp/easyadmin-bundle": "^1.17",
"friendsofsymfony/user-bundle": "~2.0",
"incenteev/composer-parameter-handler": "^2.0",
"knplabs/knp-paginator-bundle": "^2.7",
"mgilet/notification-bundle": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.0.0",
"symfony/assetic-bundle": "^2.8",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.6.4",
"symfony/symfony": "3.4.*",
"symfony/var-dumper": "^3.4",
"ext-apcu": "^5.1.7",
"twig/twig": "^1.0||^2.0",
"vich/uploader-bundle": "^1.4",
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"platform": {
"php": "5.5.9"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.4-dev"
}
}
}
我更新了 composer 添加了一个 require ext-apcu 和 require generator bundle
我知道问题出在哪里,而且似乎并不常见。
解决方案
可能 Doctrine 正在尝试确定数据库平台版本。
尝试将服务器版本添加到 Doctrine DBAL 配置中(请参阅此处的答案:https ://stackoverflow.com/a/34024275/695091 ):
#config.yml
doctrine:
dbal:
...
server_version: 5.7
推荐阅读
- postgresql - Grafana - unable to use unix as a timestamp? PostgreSQL
- javascript - Regex101:检查浮点数(例如 3.14159)是否为有效格式。(问题 11)
- oauth-2.0 - zoho crm api 和 nextjs 的静默登录
- python - Pandas & Timeseries:获取最大滚动窗口的最后日期
- python-3.x - Python从文件中导入方程组然后求解
- powershell - 如何从给定列表中获取特定的 WMI 指标
- reactjs - 如何使用选定的值自动触发 onChange 函数
- python - 使用python从JSON api中提取数据
- bash - 用另一个名称替换输出的列并将其保存为 .CSV 文件
- python - 搜索字符串以查找字符对的最佳实践方法是什么?