【发布时间】:2021-12-19 16:57:12
【问题描述】:
我正在尝试在 docker 容器文件夹(不在容器内)中执行“composer update”,但出现此错误
In ConnectionFactory.php line 79:
An exception occured while establishing a connection to figure out your pla
tform version.
You can circumvent this by setting a 'server_version' configuration value
For further information have a look at:
https://github.com/doctrine/DoctrineBundle/issues/673
In AbstractMySQLDriver.php line 112:
An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddr
esses: getaddrinfo failed: Temporary failure in name resolution
In Exception.php line 18:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Tempor
ary failure in name resolution
In PDOConnection.php line 40:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Tempor
ary failure in name resolution
In PDOConnection.php line 40:
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary
failure in name resolution
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 ConnectionFactory.php line 79:
An exception occured while establishing a connection to figure out your pla
tform version.
You can circumvent this by setting a 'server_version' configuration value
For further information have a look at:
https://github.com/doctrine/DoctrineBundle/issues/673
In AbstractMySQLDriver.php line 112:
An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddr
esses: getaddrinfo failed: Temporary failure in name resolution
In Exception.php line 18:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Tempor
ary failure in name resolution
In PDOConnection.php line 40:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Tempor
ary failure in name resolution
In PDOConnection.php line 40:
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary
failure in name resolution
我不知道如何解决它,我记得我执行了 composer install outise docker 容器但现在我无法执行 composer update ,我收到了我在问题中描述的错误
【问题讨论】:
-
您的作曲家文件可能有一个
scripts部分,其中包含一个post-update-cmd命令,这太吓人了。不幸的是,调试可能特定于您的安装。但是,您可以尝试运行composer up --no-scripts来绕过它。
标签: php docker composer-php