静态php编译加扩展错误

z

我想打包一个含这些扩展的静态php https://www.workerman.net/download
这里的没有mongodb和imagick

bin/spc build --build-cli "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,intl,mbstring,mbregex,mysqli,mysqlnd,openssl,opcache,pcntl,pdo,pdo_mysql,pdo_sqlite,pdo_pgsql,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib,mongodb,imagick"

按照 https://github.com/crazywhalecc/static-php-cli 的步骤
执行编译命令 的时候提示

[11:05:24] [CRIT] Build failed with SPC\exception\RuntimeException: Command run failed with code[2]: cd '/www/static-php/static-php-cli/source/openssl' && CFLAGS='' CC='x86_64-linux-musl-gcc -static -idirafter /www/static-php/static-php-cli/buildroot/include -idirafter /usr/include/  -idirafter /usr/include/x86_64-linux-gnu/ '  ./Configure no-shared zlib --prefix=/ --libdir=lib -static --with-zlib-include=/www/static-php/static-php-cli/buildroot/include --with-zlib-lib=/www/static-php/static-php-cli/buildroot/lib no-legacy linux-x86_64 1>/dev/null 2>&1
[11:05:24] [CRIT] Please check with --debug option to see more details.

加--debug 显示这个 AI 提示要安装 sudo yum install openssl-devel 也已经安装了, 还是一样的错误

[DEBU] Running command with direct output: cd '/www/static-php/static-php-cli/source/openssl' && CFLAGS='' CC='x86_64-linux-musl-gcc -static -idirafter /www/static-php/static-php-cli/buildroot/include -idirafter /usr/include/  -idirafter /usr/include/x86_64-linux-gnu/ '  ./Configure no-shared zlib --prefix=/ --libdir=lib -static --with-zlib-include=/www/static-php/static-php-cli/buildroot/include --with-zlib-lib=/www/static-php/static-php-cli/buildroot/lib no-legacy linux-x86_64
Can't locate IPC/Cmd.pm in @INC (@INC contains: /www/static-php/static-php-cli/source/openssl/util/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /www/static-php/static-php-cli/source/openssl/external/perl/Text-Template-1.56/lib) at /www/static-php/static-php-cli/source/openssl/util/perl/OpenSSL/config.pm line 19.
BEGIN failed--compilation aborted at /www/static-php/static-php-cli/source/openssl/util/perl/OpenSSL/config.pm line 19.
Compilation failed in require at ./Configure line 23.
BEGIN failed--compilation aborted at ./Configure line 23.

   SPC\exception\RuntimeException 

  Command run failed with code[2]: cd '/www/static-php/static-php-cli/source/openssl' && CFLAGS='' CC='x86_64-linux-musl-gcc -static -idirafter /www/static-php/static-php-cli/buildroot/include -idirafter /usr/include/  -idirafter /usr/include/x86_64-linux-gnu/ '  ./Configure no-shared zlib --prefix=/ --libdir=lib -static --with-zlib-include=/www/static-php/static-php-cli/buildroot/include --with-zlib-lib=/www/static-php/static-php-cli/buildroot/lib no-legacy linux-x86_64

  at src/globals/functions.php:89
     85▕         logger()->debug('Running command with direct output: ' . $cmd);
     86▕     }
     87▕     $ret = passthru($cmd, $code);
     88▕     if ($code !== 0) {
  ➜  89▕         throw new \SPC\exception\RuntimeException('Command run failed with code[' . $code . ']: ' . $cmd, $code);
     90▕     }
     91▕     return $ret;
     92▕ }
     93▕ 

  1   src/SPC/util/UnixShell.php:44

  2   src/SPC/builder/linux/library/openssl.php:73
      SPC\util\UnixShell::exec()

[11:11:28] [CRIT] You can report this exception to static-php-cli GitHub repo.
180 1 0
1个回答

z

编译扩展的时候报错了, 有人遇到这个问题吗
截图
截图

  • 深蓝 21天前

    使用github的actions试下看。

  • tanhongbin 20天前

    咋说呢 这个静态 的技术 感觉 还是不太成熟,我每次用都是报错,就很迷

  • caylof 20天前

    github action 我构建也报错,好像是关于 docker 什么的,有成功过的吗

  • 深蓝 20天前

    我使用actions构建的,能正常构建,但是感觉打的包要比官方包要大好多,拓展也没多几个。

  • tanhongbin 20天前

    反正很迷 actions 构建 现在报错呀

  • z 20天前

    @深蓝 , 不知道是不是环境哪里的问题;也是报错@tanhongbin

  • 深蓝 20天前

    应该是拓展的问题。

🔝