如何修复 SCRAM 身份验证需要 symfony 中的 libpq 版本 10 或更高版本?

问题描述 投票:0回答:0

我正在关注 symfony 的 symfony 快速通道书。 但是当我想创建一个实体类时:

$ symfony console make:entity Conference

我收到这个错误:

An exception occurred in the driver: SQLSTATE[08006] [7] SCRAM authentication requires libpq version 10 or above

DATABASE_URL 在教程中是这样设置的:

DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=15&charset=utf8"

我在 .zshrc 中尝试过使用和不使用它

export DOCKER_DEFAULT_PLATFORM=linux/amd64

我在 MacOS 上使用 M1。 我想这是因为在教程中使用了 Postgresql。我没有安装那个。我已经安装了 MariaDB。我遵循了相同的教程,但在 .env 设置中设置了 MariaDB。它在那里工作。

同时我已经用 brew 安装了 libpq。最后我收到了这条消息:

libpq is keg-only, which means it was not symlinked into /opt/homebrew,
because conflicts with postgres formula.

If you need to have libpq first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc

For compilers to find libpq you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"

我添加了 .zshrc 的路径以及导出标志。创建实体类仍然无效。

php postgresql symfony libpq
© www.soinside.com 2019 - 2024. All rights reserved.