Skip to content

Instantly share code, notes, and snippets.

@martinsotirov
Created July 8, 2016 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinsotirov/05f4d57f4aeaa4134d04b3f5199cd8f5 to your computer and use it in GitHub Desktop.
Save martinsotirov/05f4d57f4aeaa4134d04b3f5199cd8f5 to your computer and use it in GitHub Desktop.
Builds and installs the ssh2 extension for php 7
#!/bin/bash
echo "Installing prerequisites"
apt-get install libssh2-1 libssh2-1-dev -y &>/dev/null
echo "Downloading pecl-networking-ssh2"
wget https://github.com/php/pecl-networking-ssh2/archive/master.zip &>/dev/null
echo "Installing pecl-networking-ssh2"
unzip master.zip &>/dev/null
cd pecl-networking-ssh2-master &>/dev/null
phpize &>/dev/null
./configure &>/dev/null
make &>/dev/null
make install &>/dev/null
cd ..
rm -r master.zip pecl-networking-ssh2-master
echo "Adding ssh2 module config file"
cat > /etc/php/7.0/fpm/conf.d/20-ssh2.ini << EOF
; configuration for php ssh2 module
; priority=20
extension=ssh2.so
EOF
echo "Restarting PHP 7 fpm"
service php7.0-fpm restart &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment