Skip to content

Instantly share code, notes, and snippets.

@nickpoulos
Created August 16, 2019 21:13
Show Gist options
  • Save nickpoulos/05d4550873fe40ae106f08ed33bc54b0 to your computer and use it in GitHub Desktop.
Save nickpoulos/05d4550873fe40ae106f08ed33bc54b0 to your computer and use it in GitHub Desktop.
Install Swoole On Laravel Homestead
#!/bin/bash
ini_file=$(php -i | grep "Loaded Configuration File" | awk 'NR==1{print $5}')
php_version_output=$(php -v)
php_version=${php_version_output:4:3}
sudo pecl channel-update pecl.php.net
sudo pecl install swoole
sudo echo "extension=swoole.so" >> $ini_file
sudo service php$php_version-fpm reload
success_check=$(php -m |grep swoole)
if [ $success_check = "swoole" ] ; then
echo "Swoole installed successfully!"
else
echo "Swoole was not installed. Please check extension paths and PHP versions."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment