在Centos 6上安装lib钠的麻烦。

时间:2022-09-19 07:28:07

I'm running CENTOS 6.7 and Apache and PHP 5.4.x. I'm using the EPEL and REMI repositories. I'm trying to install the libsodium extension.

我运行CENTOS 6.7和Apache和PHP 5.4.x。我使用的是EPEL和REMI储存库。我正在尝试安装lib钠扩展。

It is my understanding that I need to install libsodium first, then the extension. Based on Googling, to get the right version, I ended on:

我的理解是我需要先安装libna,然后再扩展。基于谷歌搜索,为了得到正确的版本,我结束了:

yum --enablerepo=remi install php54-php-pecl-libsodium

and I get the following result:

我得到了如下结果:

Installed:
  php54-php-pecl-libsodium.x86_64 0:1.0.5-1.el6.remi

Dependency Installed:
  audit-libs-python.x86_64 0:2.3.7-5.el6
  environment-modules.x86_64 0:3.2.10-2.el6
  libcgroup.x86_64 0:0.40.rc1-17.el6_7
  libselinux-python.x86_64 0:2.0.94-5.8.el6
  libsemanage-python.x86_64 0:2.0.43-5.1.el6
  php54-php-common.x86_64 0:5.4.45-7.el6.remi
  php54-runtime.x86_64 0:2.1-4.el6.remi
  policycoreutils-python.x86_64 0:2.0.83-24.el6
  setools-libs.x86_64 0:3.3.7-4.el6
  setools-libs-python.x86_64 0:3.3.7-4.el6
  tcl.x86_64 1:8.5.7-6.el6

Then I type in:

然后我输入:

pecl install libsodium

and I get:

我得到:

[root@core3 tmp]# pecl install libsodium
downloading libsodium-1.0.5.tgz ...
Starting to download libsodium-1.0.5.tgz (169,801 bytes)
.....................................done: 169,801 bytes
9 source files, building
running: phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
building in /var/tmp/pear-build-rootAHK93D/libsodium-1.0.5
running: /var/tmp/libsodium/configure --with-php-config=/usr/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 whether cc understands -c and -o together... yes
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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for libsodium support... yes, shared
checking for libsodium files in default path... not found
configure: error: Please install libsodium - See https://github.com/jedisct1/libsodium
ERROR: `/var/tmp/libsodium/configure --with-php-config=/usr/bin/php-config' failed

You can see the error seems to indicate that libsodium is not installed when it is. Am I missing a step?

您可以看到这个错误似乎表明了libna没有被安装。我漏了一步吗?

2 个解决方案

#1


3  

php54-php-pecl-libsodium is a SCL package (for parallel installation).

php54-php-pecl- libna是一个SCL包(用于并行安装)。

You probably need php-pecl-libsodium.

你可能需要php-pecl-libsodium。

yum --enablerepo=remi install php-pecl-libdosium

You don't need to run the "pecl install comand".

您不需要运行“pecl安装comand”。

#2


0  

It's been a while since I've installed a PECL module, but I believe that running the initial command would have taken care of installing the module, no need to run pecl manually after that.

已经有一段时间了,我安装了一个PECL模块,但是我相信,运行初始命令将会负责安装模块,在此之后无需手动运行PECL。

Indeed, we can see that the file list from rpm shows the module installed along with a php.ini file to include it.

实际上,我们可以看到rpm中的文件列表显示了安装在php中的模块。ini文件中包含它。

$ rpm -qlp http://rpms.famillecollet.com/store/php54/php/pecl/libsodium/1.0.5/php54-php-pecl-libsodium-1.0.5-1.el6.remi.x86_64.rpm
/opt/remi/php54/root/etc/php.d/libsodium.ini
/opt/remi/php54/root/usr/lib64/php/modules/libsodium.so
/opt/remi/php54/root/usr/share/doc/pecl/libsodium
/opt/remi/php54/root/usr/share/doc/pecl/libsodium/LICENSE
/opt/remi/php54/root/usr/share/doc/pecl/libsodium/README.md
/opt/remi/php54/root/var/lib/pear/pkgxml/php54-php-pecl-libsodium.xml

Did you make sure to restart your web server?

您是否确保重新启动web服务器?

#1


3  

php54-php-pecl-libsodium is a SCL package (for parallel installation).

php54-php-pecl- libna是一个SCL包(用于并行安装)。

You probably need php-pecl-libsodium.

你可能需要php-pecl-libsodium。

yum --enablerepo=remi install php-pecl-libdosium

You don't need to run the "pecl install comand".

您不需要运行“pecl安装comand”。

#2


0  

It's been a while since I've installed a PECL module, but I believe that running the initial command would have taken care of installing the module, no need to run pecl manually after that.

已经有一段时间了,我安装了一个PECL模块,但是我相信,运行初始命令将会负责安装模块,在此之后无需手动运行PECL。

Indeed, we can see that the file list from rpm shows the module installed along with a php.ini file to include it.

实际上,我们可以看到rpm中的文件列表显示了安装在php中的模块。ini文件中包含它。

$ rpm -qlp http://rpms.famillecollet.com/store/php54/php/pecl/libsodium/1.0.5/php54-php-pecl-libsodium-1.0.5-1.el6.remi.x86_64.rpm
/opt/remi/php54/root/etc/php.d/libsodium.ini
/opt/remi/php54/root/usr/lib64/php/modules/libsodium.so
/opt/remi/php54/root/usr/share/doc/pecl/libsodium
/opt/remi/php54/root/usr/share/doc/pecl/libsodium/LICENSE
/opt/remi/php54/root/usr/share/doc/pecl/libsodium/README.md
/opt/remi/php54/root/var/lib/pear/pkgxml/php54-php-pecl-libsodium.xml

Did you make sure to restart your web server?

您是否确保重新启动web服务器?