12

PHP新增sodium模块

 4 years ago
source link: http://www.eryajf.net/5232.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
本文预计阅读时间 2 分钟

1,解决依赖。

编译的时候依赖libsodium,而且版本不能低于1.0.9,使用yum安装的版本是0.4.5,所以需要源码安装一下。

  1. $ wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz
  2. $ tar xf libsodium-1.0.18-stable.tar.gz
  3. $ cd libsodium-stable
  4. $ ./configure --prefix=/usr && make && make install

2,编译。

  1. yum -y install libsodium-devel
  2. wget https://pecl.php.net/get/libsodium-2.0.22.tgz
  3. tar xf libsodium-2.0.22.tgz
  4. cd libsodium-2.0.22
  5. /usr/local/php/bin/phpize
  6. ./configure --with-php-config=/usr/local/php/bin/php-config && make && make install

71cfeb93ly1gf8jb767t5j20rs14fajk.jpg

3,添加扩展。

  1. cat >> /usr/local/php/etc/php.ini << EOF
  2. extension=sodium.so
  3. EOF

4,重启验证。

  1. $ systemctl restart php-fpm
  2. $ php -m |grep sodium
  3. sodium

weinxin

二丫讲梵 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明PHP新增sodium模块

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK