Created
July 14, 2018 18:01
-
-
Save bitnbytesio/2a551513f085721d2c896df1840d8812 to your computer and use it in GitHub Desktop.
Install required stuff/tools for php development on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
// note: there is no error handling in this script, recommened way is to execute commands one by one | |
sudo apt -y update | |
sudo apt -y upgrade | |
sudo apt -y install wget | |
# download chrome | |
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
#install chrome | |
sudo apt install ./google-chrome-stable_current_amd64.deb -y | |
sudo add-apt-repository ppa:git-core/ppa # apt update; apt install git | |
# install git | |
sudo apt-get install git -y | |
#nginx | |
sudo apt-get install nginx -y | |
sudo apt-get install nginx-extras -y | |
#list the applications configurations | |
#sudo ufw app list | |
sudo ufw allow 'Nginx Full' | |
# check nginx status | |
#systemctl status nginx | |
# install curl | |
sudo apt-get install curl -y | |
# mysql server | |
sudo apt-get install mysql-server -y | |
# setup mysql | |
mysql_secure_installation | |
# mysql status | |
#systemctl status mysql.service | |
# setup multiple php versions | |
sudo apt install software-properties-common -y | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt update -y | |
# php 7.2 | |
sudo apt install php7.2 php7.2-fpm -y | |
sudo apt install php7.2-mysql php7.2-mbstring php7.2-gettext php7.2-bcmath php7.2-xml php7.2-gd php7.2-curl -y | |
# php 5.6 | |
sudo apt install php5.6 php5.6-fpm -y | |
sudo apt install php5.6-mysql php5.6-mbstring php5.6-gettext php5.6-bcmath php5.6-xml php5.6-gd php5.6-curl -y | |
# choose php version | |
sudo update-alternatives --set php /usr/bin/php5.6 | |
# phpmyadmin | |
sudo apt-get install phpmyadmin -y | |
# copy config of phpmyadmin and nginx | |
# remove default config of enginx | |
sudo rm -rf /etc/nginx/sites-available/default | |
sudo cp default phpmyadmin /etc/nginx/sites-available/ | |
# add host entry for phpmyadmin | |
sudo echo "127.0.0.1 phpmyadmin" >> /etc/hosts | |
# create a symbolic link to phpMyadmin content | |
sudo ln -s /usr/share/phpmyadmin /var/www/html | |
# for gtk error | |
# xhost + | |
# for php with nginx, change cgi.fix_pathinfo to 0 instead of 1 | |
# php.ini:cgi.fix_pathinfo=0 | |
# composer | |
cd ~ | |
sudo curl -sS https://getcomposer.org/installer -o composer-setup.php | |
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
# sublime | |
sudo wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
sudo apt-get install apt-transport-https -y | |
sudo echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list | |
sudo apt-get update -y | |
sudo apt-get install sublime-text -y | |
# for redirect rules | |
# put below code inside server block | |
#location /laravel { | |
# try_files $uri $uri/ /laravel/public/index.php?$query_string; | |
#} | |
# extra tools | |
#sudo apt-get install ubuntu-restricted-extras | |
# desktop tweek tools | |
#sudo apt install gnome-tweak-tool | |
# restart php service | |
#systemctl restart php5.6-fpm.service | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment