VPS侦探论坛

 找回密码
 注册
查看: 4365|回复: 3

debian10安装libsodium扩展错误

[复制链接]
发表于 2021-6-9 17:53:02 | 显示全部楼层 |阅读模式

从/usr/local/php/etc/php.ini中disable_functions里
popen,readlink 从php禁用函数里删除

root@debian:~# apt-get install libsodium-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
  libsodium23
下列【新】软件包将被安装:
  libsodium-dev libsodium23
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级                                                                                                 。
需要下载 334 kB 的归档。
解压缩后会消耗 1,211 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://deb.debian.org/debian buster/main amd64 libsodium23 amd64 1.0.17-1                                                                                                  [158 kB]
获取:2 http://deb.debian.org/debian buster/main amd64 libsodium-dev amd64 1.0.17                                                                                                 -1 [176 kB]
已下载 334 kB,耗时 1秒 (297 kB/s)
正在选中未选择的软件包 libsodium23:amd64。
(正在读取数据库 ... 系统当前共安装有 40648 个文件和目录。)
准备解压 .../libsodium23_1.0.17-1_amd64.deb  ...
正在解压 libsodium23:amd64 (1.0.17-1) ...
正在选中未选择的软件包 libsodium-dev:amd64。
准备解压 .../libsodium-dev_1.0.17-1_amd64.deb  ...
正在解压 libsodium-dev:amd64 (1.0.17-1) ...
正在设置 libsodium23:amd64 (1.0.17-1) ...
正在设置 libsodium-dev:amd64 (1.0.17-1) ...
正在处理用于 libc-bin (2.28-10) 的触发器 ...

root@debian:~# pecl install libsodium
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-upd                                                                                                 ate pecl.php.net" to update
downloading libsodium-2.0.23.tgz ...
Starting to download libsodium-2.0.23.tgz (28,505 bytes)
.........done: 28,505 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20200930
Zend Module Api No:      20200930
Zend Extension Api No:   420200930
building in /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23
running: /tmp/pear/temp/libsodium/configure --with-php-config=/usr/local/php/bin                                                                                                 /php-config
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/bin/sed
checking for pkg-config... /usr/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 we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... 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 -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -I/usr/local/php/include/php -I/usr/local/php/inclu                                                                                                 de/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend                                                                                                  -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-deb                                                                                                 ug-non-zts-20200930
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for sodium support... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for libsodium... version 1.0.17 found using pkg-config
checking for sodium_add in -lsodium... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /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 ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
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 if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libra                                                                                                 ries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
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



这个扩展安装真麻烦,每次不顺

美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2021-6-9 17:53:56 | 显示全部楼层


creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/libtool --mode=c                                                                                                 ompile cc -I. -I/tmp/pear/temp/libsodium -I/tmp/pear/temp/pear-build-rootSVoy0u/                                                                                                 libsodium-2.0.23/include -I/tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23                                                                                                 /main -I/tmp/pear/temp/libsodium -I/usr/local/php/include/php -I/usr/local/php/i                                                                                                 nclude/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Z                                                                                                 end -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib                                                                                                   -DHAVE_CONFIG_H  -g -O2    -c /tmp/pear/temp/libsodium/libsodium.c -o libsodium.                                                                                                 lo
mkdir .libs
cc -I. -I/tmp/pear/temp/libsodium -I/tmp/pear/temp/pear-build-rootSVoy0u/libsod                                                                                                 ium-2.0.23/include -I/tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/main                                                                                                  -I/tmp/pear/temp/libsodium -I/usr/local/php/include/php -I/usr/local/php/include                                                                                                 /php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I                                                                                                 /usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_                                                                                                 CONFIG_H -g -O2 -c /tmp/pear/temp/libsodium/libsodium.c  -fPIC -DPIC -o .libs/li                                                                                                 bsodium.o
/bin/bash /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/libtool --mode=l                                                                                                 ink cc -shared -I/tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/include -                                                                                                 I/tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/main -I/tmp/pear/temp/lib                                                                                                 sodium -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/loc                                                                                                 al/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/inclu                                                                                                 de/php/ext -I/usr/local/php/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2                                                                                                     -o sodium.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pea                                                                                                 r/temp/pear-build-rootSVoy0u/libsodium-2.0.23/modules  libsodium.lo -lsodium
cc -shared  .libs/libsodium.o  -lsodium  -Wl,-soname -Wl,sodium.so -o .libs/sodi                                                                                                 um.so
creating sodium.la
(cd .libs && rm -f sodium.la && ln -s ../sodium.la sodium.la)
/bin/bash /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/libtool --mode=i                                                                                                 nstall cp ./sodium.la /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/modu                                                                                                 les
cp ./.libs/sodium.so /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/modul                                                                                                 es/sodium.so
cp ./.libs/sodium.lai /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/modu                                                                                                 les/sodium.la
PATH="$PATH:/sbin" ldconfig -n /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.                                                                                                 0.23/modules
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2021-6-9 17:54:06 | 显示全部楼层

Libraries have been installed in:
   /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-rootSVoy0u/install-libsodi                                                                                                 um-2.0.23" install
Installing shared extensions:     /tmp/pear/temp/pear-build-rootSVoy0u/install-l                                                                                                 ibsodium-2.0.23/usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/
running: find "/tmp/pear/temp/pear-build-rootSVoy0u/install-libsodium-2.0.23" |                                                                                                  xargs ls -dils
805892   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23
805913   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr
805914   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local
805915   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local/php
805916   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local/php/lib
805917   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local/php/lib/php
805918   4 drwxr-xr-x 3 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local/php/lib/php/extensions
805919   4 drwxr-xr-x 2 root root   4096 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local/php/lib/php/extensions/no-debug-n                                                                                                 on-zts-20200930
805911 348 -rwxr-xr-x 1 root root 353320 6月   9 17:14 /tmp/pear/temp/pear-build                                                                                                 -rootSVoy0u/install-libsodium-2.0.23/usr/local/php/lib/php/extensions/no-debug-n                                                                                                 on-zts-20200930/sodium.so
PHP Fatal error:  Uncaught Error: Call to undefined function exec() in /usr/loca                                                                                                 l/php/lib/php/PEAR/Builder.php:465
Stack trace:
#0 /usr/local/php/lib/php/PEAR/Installer.php(1521): PEAR_Builder->build()
#1 /usr/local/php/lib/php/PEAR/Installer.php(1416): PEAR_Installer->_compileSour                                                                                                 ceFiles()
#2 /usr/local/php/lib/php/PEAR/Command/Install.php(718): PEAR_Installer->install                                                                                                 ()
#3 /usr/local/php/lib/php/PEAR/Command/Common.php(270): PEAR_Command_Install->do                                                                                                 Install()
#4 /usr/local/php/lib/php/pearcmd.php(317): PEAR_Command_Common->run()
#5 /usr/local/php/lib/php/peclcmd.php(32): require_once('...')
#6 {main}
  thrown in /usr/local/php/lib/php/PEAR/Builder.php on line 465
root@debian:~# /etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm [09-Jun-2021 17:19:02] NOTICE: PHP message: PHP Warning:  PHP S                                                                                                 tartup: Unable to load dynamic library 'sodium.so' (tried: /usr/local/php/lib/ph                                                                                                 p/extensions/no-debug-non-zts-20200930/sodium.so (/usr/local/php/lib/php/extensi                                                                                                 ons/no-debug-non-zts-20200930/sodium.so: cannot open shared object file: No such                                                                                                  file or directory), /usr/local/php/lib/php/extensions/no-debug-non-zts-20200930                                                                                                 /sodium.so.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/sodiu                                                                                                 m.so.so: cannot open shared object file: No such file or directory)) in Unknown                                                                                                  on line 0
done
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2021-6-10 08:10:26 | 显示全部楼层



erer 发表于 2021-6-9 17:54
Libraries have been installed in:
   /tmp/pear/temp/pear-build-rootSVoy0u/libsodium-2.0.23/modules

exec 禁用函数去掉,也可以直接将全部禁用函数都去掉,常见问题里有教程
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 22:40 , Processed in 0.027519 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表