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

error: ‘php_swoole_serialize’ was not declared in this scope #5652

Closed
Ser5 opened this issue Jan 4, 2025 · 4 comments
Closed

error: ‘php_swoole_serialize’ was not declared in this scope #5652

Ser5 opened this issue Jan 4, 2025 · 4 comments
Labels

Comments

@Ser5
Copy link
Contributor

Ser5 commented Jan 4, 2025

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.
    https://github.com/swoole/swoole-src
    Ran this command:
    make && make install

  2. What did you expect to see?
    Some success outcome.

  3. What did you see instead?

/bin/bash /home/ser5/swoole-src/libtool --mode=compile g++ -I. -I/home/ser5/swoole-src -I/home/ser5/swoole-src/include -I/home/ser5/swoole-src/main -I/home/ser5/swoole-src -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/home/ser5/swoole-src -I/home/ser5/swoole-src/include -I/home/ser5/swoole-src/ext-src -I/home/ser5/swoole-src/thirdparty  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11    -DENABLE_PHP_SWOOLE -DZEND_COMPILE_DL_EXT=1 -c /home/ser5/swoole-src/ext-src/swoole_server.cc -o ext-src/swoole_server.lo  -MMD -MF ext-src/swoole_server.dep -MT ext-src/swoole_server.lo
libtool: compile:  g++ -I. -I/home/ser5/swoole-src -I/home/ser5/swoole-src/include -I/home/ser5/swoole-src/main -I/home/ser5/swoole-src -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/home/ser5/swoole-src -I/home/ser5/swoole-src/include -I/home/ser5/swoole-src/ext-src -I/home/ser5/swoole-src/thirdparty -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -DENABLE_PHP_SWOOLE -DZEND_COMPILE_DL_EXT=1 -c /home/ser5/swoole-src/ext-src/swoole_server.cc -MMD -MF ext-src/swoole_server.dep -MT ext-src/swoole_server.lo  -fPIC -DPIC -o ext-src/.libs/swoole_server.o
/home/ser5/swoole-src/ext-src/swoole_server.cc: In member function ‘void swoole::ServerObject::copy_setting(zval*)’:
/home/ser5/swoole-src/ext-src/swoole_server.cc:823:28: error: ‘php_swoole_serialize’ was not declared in this scope; did you mean ‘php_var_serialize’?
  823 |     serv->private_data_4 = php_swoole_serialize(&znew_array);
      |                            ^~~~~~~~~~~~~~~~~~~~
      |                            php_var_serialize
make: *** [Makefile:290: ext-src/swoole_server.lo] Error 1
  1. What version of Swoole are you using (show your php --ri swoole)?
    Used git clone https://github.com/swoole/swoole-src.git

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

uname -a
Linux us 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

php -v

PHP 8.3.15 (cli) (built: Dec 24 2024 06:09:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.15, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.15, Copyright (c), by Zend Technologies

gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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-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 --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-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
@x-rush
Copy link

x-rush commented Jan 6, 2025

/home/xrush/.asdf/installs/php/8.4.2/swoole-src/ext-src/swoole_server.cc: In member function ‘void swoole::ServerObject::copy_setting(zval*)’:
/home/xrush/.asdf/installs/php/8.4.2/swoole-src/ext-src/swoole_server.cc:823:28: error: ‘php_swoole_serialize’ was not declared in this scope; did you mean ‘php_var_serialize’?
  823 |     serv->private_data_4 = php_swoole_serialize(&znew_array);
      |                            ^~~~~~~~~~~~~~~~~~~~
      |                            php_var_serialize
make: *** [Makefile:312: ext-src/swoole_server.lo] Error 1

php -v

PHP 8.4.2 (cli) (built: Jan  6 2025 15:23:10) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.2, Copyright (c) Zend Technologies

@NathanFreeman
Copy link
Member

The master branch is still under development for new features. Please do not use the master branch for compilation.

@Ser5
Copy link
Contributor Author

Ser5 commented Jan 6, 2025

I tried to clone Swoole like this:
git clone --branch v6.0.0 --single-branch https://github.com/swoole/swoole-src.git

Compilation went successfully.

But shouldn't the docs be updated then? Please see my pull request: #5655

@matyhtf
Copy link
Member

matyhtf commented Jan 7, 2025

f466a22

@matyhtf matyhtf closed this as completed Jan 7, 2025
@matyhtf matyhtf added the dev-bug label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants