[在Mac OS X上使用PHP连接到PostgreSQL数据库

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

我尝试使用PHP使用PDO连接到本地Postgre数据库。

  1. 运行我的代码时,错误消息显示为:Fatal error: Uncaught PDOException: could not find driver in {file path}

  2. 谷歌搜索之后,似乎更新PDO扩展名是一种对其进行修复的方法。

    然后我尝试使用代码here

  3. 执行第21行./configure --with-pdo-pgsql="/Library/PostgreSQL/9.3/",显示错误消息:configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation pathps。我检查了Postgres的设置,路径如下所示,我需要将路径更改为其中之一吗?

setting

  1. 然后我再次用Google搜索该错误。有很多帖子表明使用yum -y install postgresql-devel

  2. 但是当我尝试运行代码时,错误再次显示:-bash: yum: command not found

这是PHP初学者试图弄清楚使用以下方法从数据库中获取数据的令人困惑的旅程

PHP。有人可以提供实现此目标的方法(在Mac上吗?)>

我尝试使用PHP通过PDO连接到本地Postgre数据库。运行我的代码时,错误消息显示:致命错误:未捕获的PDOException:在{file path}中找不到驱动程序...

php pdo psql yum
1个回答
0
投票

将本地服务器从xampp更改为mapp时,问题已解决。

© www.soinside.com 2019 - 2024. All rights reserved.