swoole / ext-postgresql

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

swoole4.5.11编译最新版失败 #79

Closed luowencai closed 2 years ago

luowencai commented 2 years ago

php版本:

php -v
PHP 7.4.30 (cli) (built: Jun  9 2022 09:30:03) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

swoole版本

 php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.5.11
Built => Sep  7 2022 17:48:32
coroutine => enabled
kqueue => enabled
rwlock => enabled
pcre => enabled
zlib => 1.2.11
brotli => E16777225/D16777225
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 262144 => 262144

libpq:

brew info libpq
==> libpq: stable 14.5 (bottled) [keg-only]
Postgres C API library
https://www.postgresql.org/docs/14/libpq.html
/usr/local/Cellar/libpq/14.5 (2,340 files, 27.9MB)
  Poured from bottle on 2022-09-08 at 14:48:08
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libpq.rb
License: PostgreSQL
==> Dependencies
Required: krb5 ✔, openssl@1.1 ✔
==> Caveats
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.

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

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

For pkg-config to find libpq you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libpq/lib/pkgconfig"

==> Analytics
install: 192,636 (30 days), 492,223 (90 days), 1,669,899 (365 days)
install-on-request: 75,358 (30 days), 190,975 (90 days), 631,460 (365 days)
build-error: 3 (30 days)

gcc版本:

gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

系统:

sw_vers
ProductName:    macOS
ProductVersion: 12.4
BuildVersion:   21F79
Darwin luowencaideMacBook-Pro.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

make编译失败:

hp@7.4/7.4.30/include/php/ext/swoole/include -I/usr/local/opt/libpq/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Volumes/Documents/下载/ext-postgresql-4.8.0/swoole_postgresql.cc  -fno-common -DPIC -o .libs/swoole_postgresql.o
In file included from /Volumes/Documents/下载/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
./php_swoole_postgresql.h:21:10: fatal error: 'ext/swoole/ext-src/php_swoole_cxx.h' file not found
#include "ext/swoole/ext-src/php_swoole_cxx.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [swoole_postgresql.lo] Error 1
matyhtf commented 2 years ago

使用 4.8 或者 5.0