swoole / ext-postgresql

🐘 Coroutine-based client for PostgreSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

安装扩展失败

Dorkdomain opened this issue · comments

安装扩展时报错:
In file included from /home/ext-postgresql-master/swoole_postgresql_coro.cc:17:0:
/home/ext-postgresql-master/swoole_postgresql_coro.h:35:33: fatal error: postgresql/libpq-fe.h: No such file or directory
#include <postgresql/libpq-fe.h>

@Dorkdomain do you have libpq (and libpq-dev) installed on your system?

@Dorkdomain do you have libpq (and libpq-dev) installed on your system?

my system is centos7,I can't find libpq,so i installed postgresql10-devel

#yum list installed | grep postgresql10-devel
postgresql10-devel.x86_64 10.13-1PGDG.rhel7 @pgdg10

@Dorkdomain hmm it seems that the libpq headers doesn’t included to your include folder. Can you check similar issue r-dbi/RPostgres#21 ?

commented

先找一下有没有这个头文件

find / -name libpq-fe.h

如果存在的话,尝试修改下 #25 中修改的文件

先找一下有没有这个头文件

find / -name libpq-fe.h

如果存在的话,尝试修改下 #25 中修改的文件

我已经按照这个文件修改后成功安装了,非常感谢。

还有一个小问题,我的swoole版本本来是安装的最新的4.5.2,ext-postgresql 是克隆当前master并进行编译安装的,启动php的时候提示
php startup: ext version (40502) does not match the swoole version (40501) in unknown on line 0,这个报错应该是swoole跟扩展版本不能匹配的意思吧,然后我将swoole版本回退到4.5.1,就可以正常运行了,此时 php --ri swoole 显示 Version => 4.5.1, php --ri swoole_postgresql 显示 Version => 4.5.2,不知道这算不算一个问题。

@Dorkdomain hmm it seems that the libpq headers doesn’t included to your include folder. Can you check similar issue r-dbi/RPostgres#21 ?

Thanks, I have solved the problem

commented

@Dorkdomain 嗯是写错了,已修改。7148922

@Dorkdomain 嗯是写错了,已修改。7148922

非常感谢,已经完美解决。