Skip to content

Instantly share code, notes, and snippets.

@danteay
Last active April 8, 2020 22:43
Show Gist options
  • Save danteay/ed8338f0e9034d64352f29b8a16b11b4 to your computer and use it in GitHub Desktop.
Save danteay/ed8338f0e9034d64352f29b8a16b11b4 to your computer and use it in GitHub Desktop.
Install the available php version for your ubuntu system
#!/bin/bash
# Install PHP runtime
PHPV=$(echo $(apt search php7. | grep '^php7\.' | head -1) | tr "/" "\n" | head -1)
sudo apt install \
$PHPV \
$PHPV-cli \
$PHPV-cgi \
$PHPV-common \
$PHPV-bz2 \
$PHPV-curl \
$PHPV-dba \
$PHPV-dev \
$PHPV-fpm \
$PHPV-json \
$PHPV-mbstring \
$PHPV-mysql \
$PHPV-odbc \
$PHPV-opcache \
$PHPV-pgsql \
$PHPV-readline \
$PHPV-soap \
$PHPV-sqlite3 \
$PHPV-sybase \
$PHPV-xml \
$PHPV-xsl \
$PHPV-zip \
-y
# Install composer
curl -o- https://getcomposer.org/installer | php
sudo mv ./composer.phar /usr/local/bin/composer
echo "export PATH=\$HOME/.config/composer/vendor/bin/:\$PATH" >> ~/.zshrc
composer global require "squizlabs/php_codesniffer=*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment