Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swoole-6.0.0 and php-8.4 compile error #5634

Open
tomwijnroks opened this issue Dec 23, 2024 · 4 comments
Open

swoole-6.0.0 and php-8.4 compile error #5634

tomwijnroks opened this issue Dec 23, 2024 · 4 comments

Comments

@tomwijnroks
Copy link

tomwijnroks commented Dec 23, 2024

1. What did you do? If possible, provide a simple script for reproducing the error.

Compiled php-8.4.2 from source and tried to compile swoole-6.0.0 using the following steps:

tar xf swoole-6.0.0.tgz
cd swoole-6.0.0
/usr/local/php-8.4/bin/phpize
./configure --with-php-config=/usr/local/php-8.4/bin/php-config
make

2. What did you expect to see?

The compiled swool.so PHP extension.

3. What did you see instead?

The following compile error:

11 -DENABLE_PHP_SWOOLE -DZEND_COMPILE_DL_EXT=1 -c /usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc -MMD -MF ext-src/swoole_redis_server.dep -MT ext-src/swoole_redis_server.lo  -fPIC -DPIC -o ext-src/.libs/swoole_redis_server.o
/usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc: In function ‘int php_swoole_redis_server_onReceive(swoole::Server*, swoole::RecvData*)’:
/usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc:159:5: error: ‘php_strtolower’ was not declared in this scope; did you mean ‘php_strtok_r’?
  159 |     php_strtolower(_command, _command_len);
      |     ^~~~~~~~~~~~~~
      |     php_strtok_r
/usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc: In function ‘void zim_swoole_redis_server_setHandler(zend_execute_data*, zval*)’:
/usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc:217:5: error: ‘php_strtolower’ was not declared in this scope; did you mean ‘php_strtok_r’?
  217 |     php_strtolower(_command, _command_len);
      |     ^~~~~~~~~~~~~~
      |     php_strtok_r
/usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc: In function ‘void zim_swoole_redis_server_getHandler(zend_execute_data*, zval*)’:
/usr/src/swoole-6.0.0/ext-src/swoole_redis_server.cc:243:5: error: ‘php_strtolower’ was not declared in this scope; did you mean ‘php_strtok_r’?
  243 |     php_strtolower(_command, _command_len);
      |     ^~~~~~~~~~~~~~
      |     php_strtok_r
make: *** [Makefile:255: ext-src/swoole_redis_server.lo] Error 1

4. What version of Swoole are you using (show your php --ri swoole)?

The extension is not present yet because it did not compile.

5. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

uname -a
Linux 5.10.0-33-amd64 #1 SMP Debian 5.10.226-1 (2024-10-03) x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

php -v
PHP 8.4.2 (cli) (built: Dec 23 2024 10:23:19) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.2, Copyright (c) Zend Technologies

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
@tomwijnroks
Copy link
Author

Somewhat related to the php_strtolower errors: Imagick/imagick#690

@NathanFreeman
Copy link
Member

Where did you download the swoole-6.0.0.tgz package from?

@tomwijnroks
Copy link
Author

Where did you download the swoole-6.0.0.tgz package from?

It is the PECL swoole package from: https://pecl.php.net/package/swoole

@NathanFreeman
Copy link
Member

The output information when you execute phpize is what?
It is possible that your PHP header files are messy, which is why the incorrect version information and header file information were read.

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

No branches or pull requests

2 participants