
12

PHP新增sodium模块
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.

本文预计阅读时间 2 分钟
1,解决依赖。
编译的时候依赖libsodium,而且版本不能低于1.0.9,使用yum安装的版本是0.4.5,所以需要源码安装一下。
$ wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz
$ tar xf libsodium-1.0.18-stable.tar.gz
$ cd libsodium-stable
$ ./configure --prefix=/usr && make && make install
2,编译。
yum -y install libsodium-devel
wget https://pecl.php.net/get/libsodium-2.0.22.tgz
tar xf libsodium-2.0.22.tgz
cd libsodium-2.0.22
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config && make && make install
3,添加扩展。
cat >> /usr/local/php/etc/php.ini << EOF
extension=sodium.so
EOF
4,重启验证。
$ systemctl restart php-fpm
$ php -m |grep sodium
sodium

二丫讲梵 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明PHP新增sodium模块!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK