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

CLI 编译命令生成器,在Ubuntu-20.04.1-x64系统,编译php8.2静态文件添加pgsql编译报错bug #396

Closed
phper-hui opened this issue Mar 24, 2024 · 8 comments · Fixed by #400
Labels
bug Something isn't working need test This PR has not been tested yet, cannot merge now os/linux Things only for Linux OS

Comments

@phper-hui
Copy link

背景:通过简单几步构建https://www.workerman.net/a/1605编译php8.2静态文件

起初是想构建的扩展如下:
image
重新编译这么多扩展时间较长,顾省略这里的报错

然后编译失败,尝试只编译一个扩展pgsql的报错如下
如下:
【编译到最后一步时候:】
使用CLI 编译命令生成器(https://static-php.dev/zh/guide/cli-generator.html)
在Ubuntu-20.04.1-x64系统
编译php8.2静态文件添加pgsql编译报错bug
报错如下:
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.18 or higher is required. You are running version 3.16.3

-- Configuring incomplete, errors occurred!
[22:47:56] [ERRO] Uncaught SPC\exception\RuntimeException: Command run failed with code[1]: cd '/home/root/custom_complie_php/source/libxml2/build' && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/root/custom_complie_php/buildroot -DCMAKE_INSTALL_LIBDIR=/home/root/custom_complie_php/buildroot/lib -DCMAKE_TOOLCHAIN_FILE=/home/root/custom_complie_php/source/toolchain.cmake -DBUILD_SHARED_LIBS=OFF -DIconv_IS_BUILT_IN=OFF -DLIBXML2_WITH_ICONV=ON -DLIBXML2_WITH_ZLIB=ON -DZLIB_LIBRARY=/home/root/custom_complie_php/buildroot/lib/libz.a -DZLIB_INCLUDE_DIR=/home/root/custom_complie_php/buildroot/include -DLIBXML2_WITH_ICU=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_PROGRAMS=OFF -DLIBXML2_WITH_TESTS=OFF .. at phar:///home/root/custom_complie_php/spc/src/globals/functions.php(100)
[22:47:56] [ERRO] #0 phar:///home/root/custom_complie_php/spc/src/SPC/util/UnixShell.php(47): f_passthru('cd '/home/root/...')
#1 phar:///home/root/custom_complie_php/spc/src/SPC/builder/linux/library/libxml2.php(27): SPC\util\UnixShell->exec('cd '/home/root/...')
#2 phar:///home/root/custom_complie_php/spc/src/SPC/builder/LibraryBase.php(144): SPC\builder\linux\library\libxml2->build()
#3 phar:///home/root/custom_complie_php/spc/src/SPC/builder/LibraryBase.php(152): SPC\builder\LibraryBase->tryBuild(true)
#4 phar:///home/root/custom_complie_php/spc/src/SPC/builder/unix/UnixBuilderBase.php(143): SPC\builder\LibraryBase->tryBuild(false)
#5 phar:///home/root/custom_complie_php/spc/src/SPC/command/BuildCliCommand.php(143): SPC\builder\unix\UnixBuilderBase->buildLibs(Array)
#6 phar:///home/root/custom_complie_php/spc/src/SPC/command/BaseCommand.php(99): SPC\command\BuildCliCommand->handle()
#7 phar:///home/root/custom_complie_php/spc/vendor/symfony/console/Command/Command.php(326): SPC\command\BaseCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 phar:///home/root/custom_complie_php/spc/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 phar:///home/root/custom_complie_php/spc/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(SPC\command\BuildCliCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 phar:///home/root/custom_complie_php/spc/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 phar:///home/root/custom_complie_php/spc/bin/spc(20): Symfony\Component\Console\Application->run()
#12 /home/root/custom_complie_php/spc(8): require('phar:///home/ro...')
#13 {main}

@phper-hui
Copy link
Author

phper-hui commented Mar 24, 2024

image

image

image
最初想要加的扩展截图补充(扩展就是常用扩展+event扩展)

@phper-hui
Copy link
Author

系统截图补充
image

@jingjingxyk
Copy link
Contributor

报错的是 libxml2 ,查看 libxml2 编译日志,日志所在目录: /home/root/custom_complie_php/source/libxml2/build

@crazywhalecc crazywhalecc added bug Something isn't working need test This PR has not been tested yet, cannot merge now os/linux Things only for Linux OS labels Mar 25, 2024
@crazywhalecc
Copy link
Owner

你试一下 cmake --version,看看是不是 CMake 版本过旧了,因为我看你上面的报错信息中包含了:

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.18 or higher is required. You are running version 3.16.3

@crazywhalecc
Copy link
Owner

似乎就是因为 CMake 版本过旧导致的,我看了下我自己的 Ubuntu 和 Debian 服务器,发现 Ubuntu 18/20 的源安装的都是旧版本。只能手动升级了。另外我也后面加一个检测 CMake 版本的 doctor 项吧。

@phper-hui
Copy link
Author

phper-hui commented Mar 25, 2024 via email

@phper-hui
Copy link
Author

phper-hui commented Mar 25, 2024 via email

@crazywhalecc
Copy link
Owner

最好不要把密码放在 Issue 里。另外,我本地也有环境,我后面放假回来就看看。

Repository owner deleted a comment from phper-hui Mar 27, 2024
@crazywhalecc crazywhalecc mentioned this issue Apr 2, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need test This PR has not been tested yet, cannot merge now os/linux Things only for Linux OS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants