部署期间的Symfony2数据库配置

时间:2014-12-17 06:33:23

标签: php symfony

您好,我是symfony2网站开发的新手。我在我的localhost上开发了一个带有数据库的示例symfony2应用程序。它在我的localhost上工作正常。

我已将我的项目上传到Web服务器,所有文件都在Web服务器上工作,而不是与数据库连接的文件。当我请求与数据库连接的文件时,我遇到了这些错误。

  

警告:PDO :: __ construct():MySQL服务器已经消失了   /home/pipeline/public_html/BusinessPipeline/BusinessPipeline/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php   在第40行

     

警告:PDO :: __ construct():读取问候数据包时出错。   PID = 18547 in   /home/pipeline/public_html/BusinessPipeline/BusinessPipeline/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php   在第40行

我已按如下方式设置parameters.yml文件。

# app/config/parameters.yml
parameters:
    database_driver:    pdo_mysql
    database_host:      localhost
    database_name:      test_project
    database_user:      my_username
    database_password:  my_password

我没有改变任何东西而不是改变参数。毫升。

我可以为此问题做些什么,在部署之前是否需要进行任何配置?

提前致谢

1 个答案:

答案 0 :(得分:0)

检查MySQL Server doc是否有关于错误消息的具体问题:

B.5.2.9 MySQL server has gone away

检查wait_timeout问题