-
Notifications
You must be signed in to change notification settings - Fork 4
/
php56-mysql5-pma.sh
68 lines (54 loc) · 2.13 KB
/
php56-mysql5-pma.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
DIVIDER="\n########################################\n\n"
printf "Requirements are installing...\n"
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install software-properties-common apt-transport-https -y
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install wget nano screen unzip curl apache2 -y
sudo ufw allow in "Apache"
sudo ufw allow in "Apache Full"
sudo mkdir /var/www
sudo mkdir /var/www/html
sudo chown -R $USER:$USER /var/www
sudo chmod -R 775 /var/www
sudo rm -rf /var/www/html/index.html
sudo echo "<?php phpinfo();" >> /var/www/html/index.php
printf $DIVIDER
printf "PHP5.6 is installing..."
printf $DIVIDER
sudo apt-get install php5.6 php5.6-cli php5.6-cgi php5.6-gd php5.6-mysql php5.6-imap php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring php5.6-soap php5.6-opcache php5.6-json php5.6-readline php5.6-xml -y
printf $DIVIDER
printf "PHP5.6 has been installed.\n"
printf $DIVIDER
printf $DIVIDER
printf "Mysql is installing...\n"
printf $DIVIDER
sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
sudo apt-get update
sudo apt-get install mysql-server -y
sudo systemctl restart mysql.service
printf $DIVIDER
printf "Mysql has been installed.\n"
printf $DIVIDER
printf $DIVIDER
printf "Phpmyadmin is installing...\n"
printf $DIVIDER
sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.9.10/phpMyAdmin-4.9.10-all-languages.zip -O phpmyadmin.zip
sudo unzip phpmyadmin.zip
sudo rm phpmyadmin.zip
sudo mv phpMyAdmin-4.9.10-all-languages/ /usr/share/phpmyadmin
sudo chown -R $USER:$USER /usr/share/phpmyadmin
sudo chmod -R 755 /usr/share/phpmyadmin
sudo cat ./phpmyadmin.conf >> /etc/apache2/conf-available/phpmyadmin.conf
sudo mkdir /usr/share/phpmyadmin/tmp/
sudo chown -R www-data:www-data /usr/share/phpmyadmin/tmp/
sudo a2enmod rewrite
sudo a2enconf phpmyadmin
sudo systemctl reload apache2
printf $DIVIDER
printf "Phpmyadmin has been installed.\n"
printf $DIVIDER
sudo systemctl start apache2