forked from willianjusten/script-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installPHP56.sh
47 lines (37 loc) · 1.51 KB
/
installPHP56.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
#!/bin/bash
# http://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04#756186
# author: [email protected]
# List installed php packages
echo '\n============================================'
echo 'Listando os pacotes php instalados.'
dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
# remove unneeded packages
echo '\n============================================'
echo 'Removendo todos os pacotes php instalados.'
sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` -y
# install dependencies before add PPA
echo '\n============================================'
echo 'Instalando as dependências de pacotes.'
sudo apt-get install software-properties-common
# Add the PPA
echo '\n============================================'
echo 'Adicionando o ppa ppa:ondrej/php'
sudo add-apt-repository ppa:ondrej/php -y
# Install your PHP Version
echo '\n============================================'
echo 'Atualizando o sistema.'
sudo apt-get update
echo '\n============================================'
echo 'Instalando o Php 5.6'
sudo apt-get install php5.6 -y
# install php5.6 modules
echo '\n============================================'
echo 'Instalando os módulos Php.'
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php-pear -y
echo '\n============================================'
echo 'removendo pacotes não necessários'
sudo apt-get autoremove
# Verify your version
echo '\n============================================'
echo 'A versão Php instalada é: '
sudo php -v