
Currently using Centos7.x system, PHP uses version 7.2
Install libsodium
libsodium is necessary to install the sodium extension Dependency conditions, I provide two installation methods here, compile and directly yum
compile and install libsodium
wget https://github.com/jedisct1/libsodium/releases/download/1.0.17/libsodium-1.0.17.tar.gz tar xf libsodium-1.0.17.tar.gz cd libsodium-1.0.17 ./configure make make install
yum install libsodium
rpm -ivh http://mirrors.whsir.com/centos/whsir-release-centos.noarch.rpm yum install wlibsodium
Download php7.2 and compile sodium
yum install autoconf wget https://www.php.net/distributions/php-7.2.17.tar.gz tar xf php-7.2.17.tar.gz cd php-7.2.17/ext/sodium /usr/local/php/bin/phpize
Just run it according to the location of your phpize (if you don’t know where phpize is, just find / -name phpize to search), and you will get a prompt after running The following information, and then compile
Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718
Compile the extension module:
./configure --with-php-config=/usr/local/php/bin/php-config make make install
After the execution is completed, the directory where the extension module is compiled will be displayed/usr/local/php/lib/php /extensions/no-debug-non-zts-20170718/
Modify php.ini to add extension
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/" extension=sodium.so
Save and exit, restart php.
You can see through phpinfo that the extension has taken effect.
The above is the detailed content of php7 install sodium extension. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Notepad++7.3.1
Easy-to-use and free code editor





