Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Installation error #76

Open
stolentine opened this issue Apr 22, 2022 · 12 comments
Open

Installation error #76

stolentine opened this issue Apr 22, 2022 · 12 comments

Comments

@stolentine
Copy link

make

/bin/bash /tmp/ext-postgresql/libtool --mode=compile g++ -I. -I/tmp/ext-postgresql -I/tmp/ext-postgresql/include -I/tmp/ext-postgresql/main -I/tmp/ext-postgresql -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/tmp/ext-postgresql -I/tmp/ext-postgresql/include -I/usr/include/php/20210902/ext/swoole -I/usr/include/php/20210902/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -I/usr/include/postgresql -DENABLE_PHP_SWOOLE_POSTGRESQL -DZEND_COMPILE_DL_EXT=1 -c /tmp/ext-postgresql/swoole_postgresql.cc -o swoole_postgresql.lo -MMD -MF swoole_postgresql.dep -MT swoole_postgresql.lo
libtool: compile: g++ -I. -I/tmp/ext-postgresql -I/tmp/ext-postgresql/include -I/tmp/ext-postgresql/main -I/tmp/ext-postgresql -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -I/tmp/ext-postgresql -I/tmp/ext-postgresql/include -I/usr/include/php/20210902/ext/swoole -I/usr/include/php/20210902/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -I/usr/include/postgresql -DENABLE_PHP_SWOOLE_POSTGRESQL -DZEND_COMPILE_DL_EXT=1 -c /tmp/ext-postgresql/swoole_postgresql.cc -MMD -MF swoole_postgresql.dep -MT swoole_postgresql.lo -fPIC -DPIC -o .libs/swoole_postgresql.o
/tmp/ext-postgresql/swoole_postgresql.cc:282:55: error: macro "SW_INIT_CLASS_ENTRY" passed 5 arguments, but takes just 4
282 | swoole_postgresql_coro_methods);
| ^
In file included from /usr/include/php/20210902/ext/swoole/ext-src/php_swoole_cxx.h:19,
from /tmp/ext-postgresql/php_swoole_postgresql.h:21,
from /tmp/ext-postgresql/swoole_postgresql.cc:18:
/usr/include/php/20210902/ext/swoole/ext-src/php_swoole_private.h:504: note: macro "SW_INIT_CLASS_ENTRY" defined here
504 | #define SW_INIT_CLASS_ENTRY(module, namespace_name, short_name, methods)
|
/tmp/ext-postgresql/swoole_postgresql.cc: In function ‘void swoole_postgresql_init(int)’:
/tmp/ext-postgresql/swoole_postgresql.cc:278:5: error: ‘SW_INIT_CLASS_ENTRY’ was not declared in this scope
278 | SW_INIT_CLASS_ENTRY(swoole_postgresql_coro,
| ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile:205: swoole_postgresql.lo] Ошибка 1

@swatchion
Copy link

+1 same here. need fix.

@NathanFreeman
Copy link
Member

What version of Swoole are you using (show your php --ri swoole)?
What is your machine environment used (show your uname -a & php -v & gcc -v) ?

@swatchion
Copy link

What version of Swoole are you using (show your php --ri swoole)? What is your machine environment used (show your uname -a & php -v & gcc -v) ?

using ext-postgresql-4.8.0 build under Mac OSX Monterey

uname -a

Darwin MacBook-Pro.local 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64

gcc -v

Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

php -v

PHP 8.0.19 (cli) (built: May 12 2022 09:09:32) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.19, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.19, Copyright (c), by Zend Technologies

php --ri swoole


swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.5.11
Built => May 30 2022 16:18:46
coroutine => enabled
kqueue => enabled
rwlock => enabled
openssl => OpenSSL 3.0.1 14 Dec 2021
http2 => 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 => Off => Off
swoole.unixsock_buffer_size => 262144 => 262144

openssl

openssl@3: stable 3.0.3 (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/openssl@3/3.0.1 (6,413 files, 28MB)
  Built from source on 2022-01-25 at 16:25:55
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]
License: Apache-2.0
==> Dependencies
Required: ca-certificates ✔
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@3/certs

and run
  /usr/local/opt/openssl@3/bin/c_rehash

openssl@3 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

libpq

libpq: stable 14.3 (bottled) [keg-only]
Postgres C API library
https://www.postgresql.org/docs/14/libpq.html
/usr/local/Cellar/libpq/14.3 (2,337 files, 27.9MB)
  Poured from bottle on 2022-05-30 at 15:51:53
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libpq.rb
License: PostgreSQL
==> Dependencies
Required: krb5 ✔, [email protected] ✔
==> 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"' >> /Users/*******/.bash_profile

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"

configure as below

./configure --with-libpq-dir=/usr/local/opt/libpq --with-openssl-dir=/usr/local/Cellar/openssl@3/3.0.1


checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin21.4.0
checking host system type... x86_64-apple-darwin21.4.0
checking target system type... x86_64-apple-darwin21.4.0
checking for PHP prefix... /usr/local/Cellar/[email protected]/8.0.19
checking for PHP includes... -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/[email protected]/8.0.19/pecl/20200930
checking for PHP installed headers prefix... /usr/local/Cellar/[email protected]/8.0.19/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking swoole_postgresql support... yes, shared
checking whether to enable asan... no
checking dir of libpq... /usr/local/opt/libpq
checking dir of openssl... /usr/local/Cellar/openssl@3/3.0.1
checking if compiling with clang... yes
checking for PQconnectdb in -lpq... yes
libpq include success
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -E
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 786432
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin21.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin21.4.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged

make error occur

make

/bin/sh /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/libtool --mode=compile g++ -I. -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/opt/libpq/include -I/usr/local/Cellar/openssl@3/3.0.1/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11    -c /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc -o swoole_postgresql.lo
mkdir .libs
 g++ -I. -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/opt/libpq/include -I/usr/local/Cellar/openssl@3/3.0.1/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc  -fno-common -DPIC -o .libs/swoole_postgresql.o
In file included from /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
./php_swoole_postgresql.h:28:2: error: "Ext version does not match the Swoole version"
#error "Ext version does not match the Swoole version"
 ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:41:37: error: unknown type name 'EventType'
    bool yield(zval *_return_value, EventType event, double timeout);
                                    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:52: error: ISO C++ forbids forward references to 'enum' types
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                                   ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:46: error: 'enum swFdType' is an incomplete type
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                             ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:52: note: forward declaration of 'swFdType'
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                                   ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:391:5: error: use of undeclared identifier 'ON_SCOPE_EXIT'
    ON_SCOPE_EXIT {
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:401:9: error: use of undeclared identifier 'swoole_warning'
        swoole_warning("Unable to connect to PostgreSQL server: [%s]", PQhost(pgsql));
        ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:425:13: error: use of undeclared identifier 'swoole_warning'
            swoole_warning(" [%s, %s] ", feedback, err_msg);
            ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:467:13: error: use of undeclared identifier 'swoole_warning'
            swoole_warning("PQconnectPoll unexpected status");
            ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:752:43: error: unknown type name 'EventType'
bool PGObject::yield(zval *_return_value, EventType event, double timeout) {
                                          ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:760:5: error: use of undeclared identifier 'ON_SCOPE_EXIT'
    ON_SCOPE_EXIT {
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:769:14: error: no member named 'yield_ex' in 'swoole::Coroutine'
    if (!co->yield_ex(timeout)) {
         ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:772:17: error: no member named 'is_canceled' in 'swoole::Coroutine'
        if (co->is_canceled()) {
            ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:776:57: error: use of undeclared identifier 'SW_ERROR_CO_CANCELED'; did you mean 'SW_ERROR_AIO_CANCELED'?
                                        swoole_strerror(SW_ERROR_CO_CANCELED));
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        SW_ERROR_AIO_CANCELED
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include/swoole_error.h:95:5: note: 'SW_ERROR_AIO_CANCELED' declared here
    SW_ERROR_AIO_CANCELED,
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:777:24: error: no member named 'is_timedout' in 'swoole::Coroutine'
        } else if (co->is_timedout()) {
                   ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:781:57: error: use of undeclared identifier 'SW_ERROR_CO_TIMEDOUT'; did you mean 'SW_ERROR_AIO_TIMEOUT'?
                                        swoole_strerror(SW_ERROR_CO_TIMEDOUT));
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        SW_ERROR_AIO_TIMEOUT
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include/swoole_error.h:96:5: note: 'SW_ERROR_AIO_TIMEOUT' declared here
    SW_ERROR_AIO_TIMEOUT,
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:1227:9: error: use of undeclared identifier 'swoole_warning'
        swoole_warning("error:[%s]", err_msg);
        ^
16 errors generated.
make: *** [swoole_postgresql.lo] Error 1

Thanks for quick response. Need other logs? please let me know.

@CXY037
Copy link

CXY037 commented Jun 6, 2022

error: "Ext version does not match the Swoole version"

@CXY037
Copy link

CXY037 commented Jun 6, 2022

把这个文件的版本号改掉就行了php_swoole_postgresql.h
你swoole版本是多少替换为多少
#define PHP_SWOOLE_EXT_PLUS_VERSION "4.8.8"
#define PHP_SWOOLE_EXT_PLUS_VERSION_ID 40808

#if SWOOLE_VERSION_ID < 40808

@swatchion
Copy link

swatchion commented Jun 6, 2022

swoole version 4.5.11, version number changed, still throw exception after make, log as below, please help

#include "config.h"

#define PHP_SWOOLE_EXT_PLUS_VERSION     "4.5.11"
#define PHP_SWOOLE_EXT_PLUS_VERSION_ID  40511

#if SWOOLE_VERSION_ID < 40511
#error "Ext version does not match the Swoole version"
#endif

#ifdef __APPLE__
#include <libpq-fe.h>
#endif

#ifdef __linux__
#include <postgresql/libpq-fe.h>
#endif

#include <zend_portability.h>

#endif
/bin/sh /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/libtool --mode=compile g++ -I. -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/opt/libpq/include -I/usr/local/Cellar/openssl@3/3.0.1/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11    -c /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc -o swoole_postgresql.lo
mkdir .libs
 g++ -I. -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/opt/libpq/include -I/usr/local/Cellar/openssl@3/3.0.1/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc  -fno-common -DPIC -o .libs/swoole_postgresql.o
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:41:37: error: unknown type name 'EventType'
    bool yield(zval *_return_value, EventType event, double timeout);
                                    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:52: error: ISO C++ forbids forward references to 'enum' types
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                                   ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:46: error: 'enum swFdType' is an incomplete type
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                             ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:52: note: forward declaration of 'swFdType'
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                                   ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:391:5: error: use of undeclared identifier 'ON_SCOPE_EXIT'
    ON_SCOPE_EXIT {
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:401:9: error: use of undeclared identifier 'swoole_warning'
        swoole_warning("Unable to connect to PostgreSQL server: [%s]", PQhost(pgsql));
        ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:425:13: error: use of undeclared identifier 'swoole_warning'
            swoole_warning(" [%s, %s] ", feedback, err_msg);
            ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:467:13: error: use of undeclared identifier 'swoole_warning'
            swoole_warning("PQconnectPoll unexpected status");
            ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:752:43: error: unknown type name 'EventType'
bool PGObject::yield(zval *_return_value, EventType event, double timeout) {
                                          ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:760:5: error: use of undeclared identifier 'ON_SCOPE_EXIT'
    ON_SCOPE_EXIT {
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:769:14: error: no member named 'yield_ex' in 'swoole::Coroutine'
    if (!co->yield_ex(timeout)) {
         ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:772:17: error: no member named 'is_canceled' in 'swoole::Coroutine'
        if (co->is_canceled()) {
            ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:776:57: error: use of undeclared identifier 'SW_ERROR_CO_CANCELED'; did you mean 'SW_ERROR_AIO_CANCELED'?
                                        swoole_strerror(SW_ERROR_CO_CANCELED));
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        SW_ERROR_AIO_CANCELED
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include/swoole_error.h:95:5: note: 'SW_ERROR_AIO_CANCELED' declared here
    SW_ERROR_AIO_CANCELED,
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:777:24: error: no member named 'is_timedout' in 'swoole::Coroutine'
        } else if (co->is_timedout()) {
                   ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:781:57: error: use of undeclared identifier 'SW_ERROR_CO_TIMEDOUT'; did you mean 'SW_ERROR_AIO_TIMEOUT'?
                                        swoole_strerror(SW_ERROR_CO_TIMEDOUT));
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        SW_ERROR_AIO_TIMEOUT
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include/swoole_error.h:96:5: note: 'SW_ERROR_AIO_TIMEOUT' declared here
    SW_ERROR_AIO_TIMEOUT,
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:1227:9: error: use of undeclared identifier 'swoole_warning'
        swoole_warning("error:[%s]", err_msg);
        ^
15 errors generated.
make: *** [swoole_postgresql.lo] Error 1

@CXY037
Copy link

CXY037 commented Jun 8, 2022

只有4.8以上版本才能这样改,之前的我测试过不行

@CXY037
Copy link

CXY037 commented Jun 8, 2022

swoole version 4.5.11, version number changed, still throw exception after make, log as below, please help

#include "config.h"

#define PHP_SWOOLE_EXT_PLUS_VERSION     "4.5.11"
#define PHP_SWOOLE_EXT_PLUS_VERSION_ID  40511

#if SWOOLE_VERSION_ID < 40511
#error "Ext version does not match the Swoole version"
#endif

#ifdef __APPLE__
#include <libpq-fe.h>
#endif

#ifdef __linux__
#include <postgresql/libpq-fe.h>
#endif

#include <zend_portability.h>

#endif
/bin/sh /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/libtool --mode=compile g++ -I. -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/opt/libpq/include -I/usr/local/Cellar/openssl@3/3.0.1/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11    -c /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc -o swoole_postgresql.lo
mkdir .libs
 g++ -I. -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/opt/libpq/include -I/usr/local/Cellar/openssl@3/3.0.1/include -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0 -I/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc  -fno-common -DPIC -o .libs/swoole_postgresql.o
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:41:37: error: unknown type name 'EventType'
    bool yield(zval *_return_value, EventType event, double timeout);
                                    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:52: error: ISO C++ forbids forward references to 'enum' types
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                                   ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:46: error: 'enum swFdType' is an incomplete type
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                             ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:385:52: note: forward declaration of 'swFdType'
    object->socket = swoole::make_socket(fd, (enum swFdType) PHP_SWOOLE_FD_POSTGRESQL);
                                                   ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:391:5: error: use of undeclared identifier 'ON_SCOPE_EXIT'
    ON_SCOPE_EXIT {
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:401:9: error: use of undeclared identifier 'swoole_warning'
        swoole_warning("Unable to connect to PostgreSQL server: [%s]", PQhost(pgsql));
        ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:425:13: error: use of undeclared identifier 'swoole_warning'
            swoole_warning(" [%s, %s] ", feedback, err_msg);
            ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:467:13: error: use of undeclared identifier 'swoole_warning'
            swoole_warning("PQconnectPoll unexpected status");
            ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:752:43: error: unknown type name 'EventType'
bool PGObject::yield(zval *_return_value, EventType event, double timeout) {
                                          ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:760:5: error: use of undeclared identifier 'ON_SCOPE_EXIT'
    ON_SCOPE_EXIT {
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:769:14: error: no member named 'yield_ex' in 'swoole::Coroutine'
    if (!co->yield_ex(timeout)) {
         ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:772:17: error: no member named 'is_canceled' in 'swoole::Coroutine'
        if (co->is_canceled()) {
            ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:776:57: error: use of undeclared identifier 'SW_ERROR_CO_CANCELED'; did you mean 'SW_ERROR_AIO_CANCELED'?
                                        swoole_strerror(SW_ERROR_CO_CANCELED));
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        SW_ERROR_AIO_CANCELED
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include/swoole_error.h:95:5: note: 'SW_ERROR_AIO_CANCELED' declared here
    SW_ERROR_AIO_CANCELED,
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:777:24: error: no member named 'is_timedout' in 'swoole::Coroutine'
        } else if (co->is_timedout()) {
                   ~~  ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:781:57: error: use of undeclared identifier 'SW_ERROR_CO_TIMEDOUT'; did you mean 'SW_ERROR_AIO_TIMEOUT'?
                                        swoole_strerror(SW_ERROR_CO_TIMEDOUT));
                                                        ^~~~~~~~~~~~~~~~~~~~
                                                        SW_ERROR_AIO_TIMEOUT
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/include/swoole_error.h:96:5: note: 'SW_ERROR_AIO_TIMEOUT' declared here
    SW_ERROR_AIO_TIMEOUT,
    ^
/Users/******/Documents/Work/local/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:1227:9: error: use of undeclared identifier 'swoole_warning'
        swoole_warning("error:[%s]", err_msg);
        ^
15 errors generated.
make: *** [swoole_postgresql.lo] Error 1

你看下每次发布release的时候官方也是这样改的,然后我测试了下确实可以

@swatchion
Copy link

Ok, will try to build under 4.8 and report back. Thanks.

@swatchion
Copy link

Still no lucky, this is frustrating.

php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.8.10
Built => Jun  8 2022 14:55:38
coroutine => enabled with boost asm context
kqueue => enabled
rwlock => enabled
openssl => OpenSSL 3.0.1 14 Dec 2021
dtls => enabled
http2 => 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 => Off => Off
swoole.unixsock_buffer_size => 262144 => 262144

The above indicate the openssl is enabled in swoole.

openssl install location

ls  /usr/local/Cellar/openssl@3/3.0.1

AUTHORS.md           INSTALL_RECEIPT.json NEWS.md              bin                  lib
CHANGES.md           LICENSE.txt          README.md            include              share

ls /usr/local/Cellar/openssl@3/3.0.1/lib

engines-3         libcrypto.3.dylib libcrypto.a       libcrypto.dylib   libssl.3.dylib    libssl.a          libssl.dylib      ossl-modules      pkgconfig

tried to configure with or without --with-openssl-dir=/usr/local/Cellar/openssl@3/3.0.1 before make, both give the error as below:

/bin/sh /Users/******/env_base/ext-postgresql-4.8.0/libtool --mode=compile g++ -I. -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/Cellar/libpq/14.3/include -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/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 /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc -o swoole_postgresql.lo
mkdir .libs
 g++ -I. -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/Cellar/libpq/14.3/include -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/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 /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc  -fno-common -DPIC -o .libs/swoole_postgresql.o
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:25:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:99:2: error: "Enable openssl support, require openssl library"
#error "Enable openssl support, require openssl library"
 ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:23: error: ISO C++ forbids forward references to 'enum' types
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                      ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:37: error: incomplete result type 'enum swSocket_type' in function definition
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                                    ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:23: note: forward declaration of 'swSocket_type'
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                      ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:163:12: error: 'enum swSocket_type' is an incomplete type
    return (enum swSocket_type) (type & (~SW_FLAG_SYNC) & (~SW_FLAG_ASYNC) & (~SW_FLAG_KEEP) & (~SW_SOCK_SSL));
           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:23: note: forward declaration of 'swSocket_type'
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                      ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:54:9: warning: 'PHP_SWOOLE_API' macro redefined [-Wmacro-redefined]
#define PHP_SWOOLE_API __attribute__((visibility("default")))
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:79:10: note: previous definition is here
# define PHP_SWOOLE_API __attribute__ ((visibility("default")))
         ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:59:9: warning: 'SW_CHECK_RETURN' macro redefined [-Wmacro-redefined]
#define SW_CHECK_RETURN(s)                                                                                             \
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:84:9: note: previous definition is here
#define SW_CHECK_RETURN(s)      if(s<0){RETURN_FALSE;}else{RETURN_TRUE;}
        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:65:9: warning: 'SW_LOCK_CHECK_RETURN' macro redefined [-Wmacro-redefined]
#define SW_LOCK_CHECK_RETURN(s)                                                                                        \
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:85:9: note: previous definition is here
#define SW_LOCK_CHECK_RETURN(s) if(s==0){RETURN_TRUE;}else{zend_update_property_long(NULL,SW_Z8_OBJ_P(ZEND_THIS),SW_STRL("errCode"),s);RETURN_FALSE;}
        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:106:6: error: redefinition of 'php_swoole_client_callback_type'
enum php_swoole_client_callback_type {
     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:116:6: note: previous definition is here
enum php_swoole_client_callback_type
     ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:122:6: error: redefinition of 'php_swoole_fd_type'
enum php_swoole_fd_type {
     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:133:6: note: previous definition is here
enum php_swoole_fd_type
     ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:136:6: error: definition of type 'php_swoole_req_status' conflicts with typedef of the same name
enum php_swoole_req_status {
     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:158:3: note: 'php_swoole_req_status' declared here
} php_swoole_req_status;
  ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:277:28: error: redefinition of 'php_swoole_websocket_frame_is_object'
static sw_inline zend_bool php_swoole_websocket_frame_is_object(zval *zdata) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:275:28: note: previous definition is here
static sw_inline zend_bool php_swoole_websocket_frame_is_object(zval *zdata)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:281:25: error: redefinition of 'php_swoole_get_send_data'
static sw_inline size_t php_swoole_get_send_data(zval *zdata, char **str) {
                        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:280:25: note: previous definition is here
static sw_inline size_t php_swoole_get_send_data(zval *zdata, char **str)
                        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:445:28: error: redefinition of 'ZVAL_IS_BOOL'
static sw_inline zend_bool ZVAL_IS_BOOL(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:452:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_BOOL(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:463:28: error: redefinition of 'ZVAL_IS_LONG'
static sw_inline zend_bool ZVAL_IS_LONG(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:459:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_LONG(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:469:28: error: redefinition of 'ZVAL_IS_STRING'
static sw_inline zend_bool ZVAL_IS_STRING(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:466:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_STRING(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:475:28: error: redefinition of 'Z_BVAL_P'
static sw_inline zend_bool Z_BVAL_P(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:473:28: note: previous definition is here
static sw_inline zend_bool Z_BVAL_P(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:481:28: error: redefinition of 'ZVAL_IS_ARRAY'
static sw_inline zend_bool ZVAL_IS_ARRAY(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:480:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_ARRAY(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:496:24: error: redefinition of 'sw_malloc_zval'
static sw_inline zval *sw_malloc_zval() {
                       ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:486:24: note: previous definition is here
static sw_inline zval *sw_malloc_zval()
                       ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:500:24: error: redefinition of 'sw_zval_dup'
static sw_inline zval *sw_zval_dup(zval *val) {
                       ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:504:24: note: previous definition is here
static sw_inline zval *sw_zval_dup(zval *val)
                       ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:506:23: error: redefinition of 'sw_zval_free'
static sw_inline void sw_zval_free(zval *val) {
                      ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:511:23: note: previous definition is here
static sw_inline void sw_zval_free(zval *val)
                      ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:538:31: error: redefinition of 'sw_zend_string_recycle'
static sw_inline zend_string *sw_zend_string_recycle(zend_string *s, size_t alloc_len, size_t real_len) {
                              ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:541:31: note: previous definition is here
static sw_inline zend_string* sw_zend_string_recycle(zend_string *s, size_t alloc_len, size_t real_len)
                              ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:554:9: warning: 'php_swoole_array_get_value' macro redefined [-Wmacro-redefined]
#define php_swoole_array_get_value(ht, str, v) ((v = zend_hash_str_find(ht, str, sizeof(str) - 1)) && !ZVAL_IS_NULL(v))
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:562:9: note: previous definition is here
#define php_swoole_array_get_value(ht, str, v) ((v = zend_hash_str_find(ht, str, sizeof(str)-1)) && !ZVAL_IS_NULL(v))
        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:557:22: error: redefinition of 'php_swoole_array_length_safe'
static sw_inline int php_swoole_array_length_safe(zval *zarray) {
                     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:564:22: note: previous definition is here
static sw_inline int php_swoole_array_length_safe(zval *zarray)
                     ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:571:9: warning: 'SW_HASHTABLE_FOREACH_START2' macro redefined [-Wmacro-redefined]
#define SW_HASHTABLE_FOREACH_START2(ht, k, klen, ktype, _val)                                                          \
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:580:9: note: previous definition is here
#define SW_HASHTABLE_FOREACH_START2(ht, k, klen, ktype, _val) zend_string *_foreach_key;\
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
make: *** [swoole_postgresql.lo] Error 1

@CXY037
Copy link

CXY037 commented Jun 8, 2022 via email

@CXY037
Copy link

CXY037 commented Jun 8, 2022

Still no lucky, this is frustrating.

php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.8.10
Built => Jun  8 2022 14:55:38
coroutine => enabled with boost asm context
kqueue => enabled
rwlock => enabled
openssl => OpenSSL 3.0.1 14 Dec 2021
dtls => enabled
http2 => 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 => Off => Off
swoole.unixsock_buffer_size => 262144 => 262144

The above indicate the openssl is enabled in swoole.

openssl install location

ls  /usr/local/Cellar/openssl@3/3.0.1

AUTHORS.md           INSTALL_RECEIPT.json NEWS.md              bin                  lib
CHANGES.md           LICENSE.txt          README.md            include              share

ls /usr/local/Cellar/openssl@3/3.0.1/lib

engines-3         libcrypto.3.dylib libcrypto.a       libcrypto.dylib   libssl.3.dylib    libssl.a          libssl.dylib      ossl-modules      pkgconfig

tried to configure with or without --with-openssl-dir=/usr/local/Cellar/openssl@3/3.0.1 before make, both give the error as below:

/bin/sh /Users/******/env_base/ext-postgresql-4.8.0/libtool --mode=compile g++ -I. -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/Cellar/libpq/14.3/include -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/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 /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc -o swoole_postgresql.lo
mkdir .libs
 g++ -I. -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/Users/******/env_base/ext-postgresql-4.8.0/main -I/Users/******/env_base/ext-postgresql-4.8.0 -I/usr/local/Cellar/[email protected]/8.0.19/include/php -I/usr/local/Cellar/[email protected]/8.0.19/include/php/main -I/usr/local/Cellar/[email protected]/8.0.19/include/php/TSRM -I/usr/local/Cellar/[email protected]/8.0.19/include/php/Zend -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/date/lib -I/usr/local/Cellar/libpq/14.3/include -I/Users/******/env_base/ext-postgresql-4.8.0 -I/Users/******/env_base/ext-postgresql-4.8.0/include -I/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole -I/usr/local/Cellar/[email protected]/8.0.19/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 /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc  -fno-common -DPIC -o .libs/swoole_postgresql.o
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:25:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:99:2: error: "Enable openssl support, require openssl library"
#error "Enable openssl support, require openssl library"
 ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:23: error: ISO C++ forbids forward references to 'enum' types
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                      ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:37: error: incomplete result type 'enum swSocket_type' in function definition
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                                    ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:23: note: forward declaration of 'swSocket_type'
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                      ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:163:12: error: 'enum swSocket_type' is an incomplete type
    return (enum swSocket_type) (type & (~SW_FLAG_SYNC) & (~SW_FLAG_ASYNC) & (~SW_FLAG_KEEP) & (~SW_SOCK_SSL));
           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:161:23: note: forward declaration of 'swSocket_type'
static sw_inline enum swSocket_type php_swoole_socktype(long type)
                      ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:54:9: warning: 'PHP_SWOOLE_API' macro redefined [-Wmacro-redefined]
#define PHP_SWOOLE_API __attribute__((visibility("default")))
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:79:10: note: previous definition is here
# define PHP_SWOOLE_API __attribute__ ((visibility("default")))
         ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:59:9: warning: 'SW_CHECK_RETURN' macro redefined [-Wmacro-redefined]
#define SW_CHECK_RETURN(s)                                                                                             \
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:84:9: note: previous definition is here
#define SW_CHECK_RETURN(s)      if(s<0){RETURN_FALSE;}else{RETURN_TRUE;}
        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:65:9: warning: 'SW_LOCK_CHECK_RETURN' macro redefined [-Wmacro-redefined]
#define SW_LOCK_CHECK_RETURN(s)                                                                                        \
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:85:9: note: previous definition is here
#define SW_LOCK_CHECK_RETURN(s) if(s==0){RETURN_TRUE;}else{zend_update_property_long(NULL,SW_Z8_OBJ_P(ZEND_THIS),SW_STRL("errCode"),s);RETURN_FALSE;}
        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:106:6: error: redefinition of 'php_swoole_client_callback_type'
enum php_swoole_client_callback_type {
     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:116:6: note: previous definition is here
enum php_swoole_client_callback_type
     ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:122:6: error: redefinition of 'php_swoole_fd_type'
enum php_swoole_fd_type {
     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:133:6: note: previous definition is here
enum php_swoole_fd_type
     ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:136:6: error: definition of type 'php_swoole_req_status' conflicts with typedef of the same name
enum php_swoole_req_status {
     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:158:3: note: 'php_swoole_req_status' declared here
} php_swoole_req_status;
  ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:277:28: error: redefinition of 'php_swoole_websocket_frame_is_object'
static sw_inline zend_bool php_swoole_websocket_frame_is_object(zval *zdata) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:275:28: note: previous definition is here
static sw_inline zend_bool php_swoole_websocket_frame_is_object(zval *zdata)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:281:25: error: redefinition of 'php_swoole_get_send_data'
static sw_inline size_t php_swoole_get_send_data(zval *zdata, char **str) {
                        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:280:25: note: previous definition is here
static sw_inline size_t php_swoole_get_send_data(zval *zdata, char **str)
                        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:445:28: error: redefinition of 'ZVAL_IS_BOOL'
static sw_inline zend_bool ZVAL_IS_BOOL(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:452:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_BOOL(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:463:28: error: redefinition of 'ZVAL_IS_LONG'
static sw_inline zend_bool ZVAL_IS_LONG(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:459:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_LONG(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:469:28: error: redefinition of 'ZVAL_IS_STRING'
static sw_inline zend_bool ZVAL_IS_STRING(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:466:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_STRING(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:475:28: error: redefinition of 'Z_BVAL_P'
static sw_inline zend_bool Z_BVAL_P(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:473:28: note: previous definition is here
static sw_inline zend_bool Z_BVAL_P(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:481:28: error: redefinition of 'ZVAL_IS_ARRAY'
static sw_inline zend_bool ZVAL_IS_ARRAY(zval *v) {
                           ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:480:28: note: previous definition is here
static sw_inline zend_bool ZVAL_IS_ARRAY(zval *v)
                           ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:496:24: error: redefinition of 'sw_malloc_zval'
static sw_inline zval *sw_malloc_zval() {
                       ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:486:24: note: previous definition is here
static sw_inline zval *sw_malloc_zval()
                       ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:500:24: error: redefinition of 'sw_zval_dup'
static sw_inline zval *sw_zval_dup(zval *val) {
                       ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:504:24: note: previous definition is here
static sw_inline zval *sw_zval_dup(zval *val)
                       ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:506:23: error: redefinition of 'sw_zval_free'
static sw_inline void sw_zval_free(zval *val) {
                      ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:511:23: note: previous definition is here
static sw_inline void sw_zval_free(zval *val)
                      ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:538:31: error: redefinition of 'sw_zend_string_recycle'
static sw_inline zend_string *sw_zend_string_recycle(zend_string *s, size_t alloc_len, size_t real_len) {
                              ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:541:31: note: previous definition is here
static sw_inline zend_string* sw_zend_string_recycle(zend_string *s, size_t alloc_len, size_t real_len)
                              ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:554:9: warning: 'php_swoole_array_get_value' macro redefined [-Wmacro-redefined]
#define php_swoole_array_get_value(ht, str, v) ((v = zend_hash_str_find(ht, str, sizeof(str) - 1)) && !ZVAL_IS_NULL(v))
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:562:9: note: previous definition is here
#define php_swoole_array_get_value(ht, str, v) ((v = zend_hash_str_find(ht, str, sizeof(str)-1)) && !ZVAL_IS_NULL(v))
        ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:557:22: error: redefinition of 'php_swoole_array_length_safe'
static sw_inline int php_swoole_array_length_safe(zval *zarray) {
                     ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:564:22: note: previous definition is here
static sw_inline int php_swoole_array_length_safe(zval *zarray)
                     ^
In file included from /Users/******/env_base/ext-postgresql-4.8.0/swoole_postgresql.cc:18:
In file included from ./php_swoole_postgresql.h:21:
In file included from /usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_cxx.h:19:
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole_private.h:571:9: warning: 'SW_HASHTABLE_FOREACH_START2' macro redefined [-Wmacro-redefined]
#define SW_HASHTABLE_FOREACH_START2(ht, k, klen, ktype, _val)                                                          \
        ^
/usr/local/Cellar/[email protected]/8.0.19/include/php/ext/swoole/ext-src/php_swoole.h:580:9: note: previous definition is here
#define SW_HASHTABLE_FOREACH_START2(ht, k, klen, ktype, _val) zend_string *_foreach_key;\
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
make: *** [swoole_postgresql.lo] Error 1

[+] Building 131.2s (10/10) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.71kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/php:8.0-cli-alpine 15.4s
=> CACHED [1/5] FROM docker.io/library/php:8.0-cli-alpine@sha256:f2dc253 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 1.76MB 0.1s
=> [2/5] COPY ./ext-postgresql-4.8.0 /tmp/ext-postgresql 0.0s
=> [3/5] COPY ./swoole-src-4.8.10.tar.gz /tmp/swoole-src-4.8.10.tar.gz 0.0s
=> [4/5] RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /e 115.5s
=> [5/5] WORKDIR /var/www/project 0.0s
=> exporting to image 0.2s
=> => exporting layers 0.1s
=> => writing image sha256:1311bb65a635e9c70eb10508828d0fba1a1b2df0b1123 0.0s
=> => naming to docker.io/arm/swoole 0.0s

in my docker. I build finished

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants