![](/img/trans.png)
[英]PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
[英]Deployment error - SQLSTATE[HY000] [2002] Connection refused
我正在开发一个symfony应用程序,由于具有有效的登录名,注册名,最近我试图将我的工作部署到服务器上。
本地一切正常! 注意尽管我在本地主机上使用RDS数据库。 我没有使用开发数据库。
最初它抱怨服务器上的PHP版本,所以我将其更新为5.6并重新发行,现在我的日志中包含以下内容!
Creating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
(Executor::NonZeroExitStatus)
[2016-01-12T16:22:49.583Z] ERROR [2219] : Command CMD-AppDeploy failed!
任何更多信息都需要询问不正确的更新! 任何帮助将不胜感激!
这意味着该学说无法建立与数据库的连接。
当你部署的symfony应用作曲家找parameters.yml.dist
和复制的文件中的所有这些参数parameters.yml
将被用于配置Symfony和其他任何捆绑。
您需要在parameters.yml.dist
设置数据库的正确信息(主机地址,用户名,密码,数据库名称)
连接被拒绝,所以是时候进行系统的调试了:
db-production
则在操作系统的hosts文件中检查该条目,并确保其解析为127.0.0.1
。 通常,我希望将主机设置为localhost
,在这种情况下,您仍然可以检查hosts文件,但是它可能在其中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.