swoole / ext-postgresql

🐘 Coroutine-based client for PostgreSQL
64 stars 21 forks source link

安装扩展失败 #24

Closed Dorkdomain closed 4 years ago

Dorkdomain commented 4 years ago

安装扩展时报错: 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>

codercms commented 4 years ago

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

Dorkdomain commented 4 years ago

@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

codercms commented 4 years ago

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

sy-records commented 4 years ago

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

find / -name libpq-fe.h

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

Dorkdomain commented 4 years ago

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

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 commented 4 years ago

@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

sy-records commented 4 years ago

@Dorkdomain 嗯是写错了,已修改。https://github.com/swoole/ext-postgresql/pull/25/commits/71489222e0559b3c25ad7ad5b4e7c455afd35544

Dorkdomain commented 4 years ago

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

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