title: AWS EC2 standard AWS AMI with PHP 7.0 - install libsodium recipe
body: <p>(edited for clarity - rolled in accepted answer)</p>
  
  <p>Libsodium has been prepped for PHP 7.  In doing this, the namespace was removed and a prefix of sodium_ for methods and SODIUM_ for constants was added.  Also the version methods were removed.</p>
  
  <p>This github page documents all the new functions and constants and the project provides backward compatibility with the \Sodium namespace: <a href="https://github.com/Firehed/sodium/blob/master/src/we_cant_have_nice_things.php" rel="nofollow noreferrer">https://github.com/Firehed/sodium/blob/master/src/we_cant_have_nice_things.php</a></p>
  
  <p>Recipe: install Libsodium on PHP 7 on and AWS AMI</p>
  
  <pre><code># PHP 7.0 Libsodium install AWS AMI
  yum install -y php7-pear re2c php70-devel
  yum groupinstall -y "Development Tools"
  
  pecl7 install libsodium
  
  vi /etc/php-7.0.d/20-libsodium.ini
      ; Enable libsodium extension module
      extension=sodium.so
  
  service httpd restart
  </code></pre>
  
  <p>command line test to verify sodium is installed</p>
  
  <pre><code>php7 --info | grep sodium
  </code></pre>
  
  <p>test php function to verify calling pattern for password hash</p>
  
  <pre><code>&lt;?php
  $password = "hello";
  $hash_str = sodium_crypto_pwhash_str(
      $password,
      \SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
      \SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
  );
  var_dump($password, $hash_str);
  </code></pre>
  
  <p>Thanks to @GracefulRestart for the help.</p>