【问题标题】:Adding .env file to UserFrosting将 .env 文件添加到 UserFrosting
【发布时间】:2017-03-05 19:19:55
【问题描述】:

我在将 MySQL 数据库链接到 Userfrosting 时遇到问题。该指南提供了一个将.enr 文件添加到目录的示例,以便 Userfrosting 可以读取数据库凭据,但它似乎不起作用。

谁能给我一个关于如何做的深入教程?

这是运行install.php时的错误代码:

Could not connect to the database '@/'.  Please check your database
configuration and/or google the exception shown below:
  Exception: SQLSTATE[HY000] [2002] No such file or directory
  Trace:
    #0 /Applications/XAMPP/xamppfiles/htdocs/myUserFrostingProject/migrations/install.php(63): PDO->__construct('mysql:host=;dbn...', NULL, NULL)
    #1 {main}

【问题讨论】:

    标签: php mysql pdo userfrosting


    【解决方案1】:

    对于 MAMP,DB_HOST 需要设置为 127.0.0.1 而不是 localhost。 XAMPP 的情况可能与此相同。已经有一个关于此的公开拉取请求。见https://github.com/userfrosting/UserFrosting/pull/659

    【讨论】:

      猜你喜欢
      • 2018-09-09
      • 2020-04-17
      • 2019-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多