-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathphp-upgrade.sh
More file actions
executable file
·31 lines (31 loc) · 1.04 KB
/
php-upgrade.sh
File metadata and controls
executable file
·31 lines (31 loc) · 1.04 KB
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
# $1 ==> the php version
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/local/bin/phpbrew
phpbrew -v
phpbrew init
echo "[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc" >> ~/.bashrc
#vim ~/.bashrc
export PHPBREW_SET_PROMPT=1
export PHPBREW_RC_ENABLE=1
# Paste this:
# [[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
# and
# source /home/ubuntu/.phpbrew/bashrc
#
sudo phpbrew self-update
sudo chmod oga+rw /usr/lib/apache2/modules
sudo chmod -R oga+rw /etc/apache2/
sudo chmod -R oga+rw /var/lib/apache2/module/enabled_by_admin
phpbrew -d install $1 +default +mysql +apxs2
source ~/.phpbrew/bashrc
phpbrew switch $1
phpbrew use $1
phpbrew ext install curl
cp /etc/apache2/mods-available/php5.conf /etc/apache2/mods-available/php7.conf
ln -s /etc/apache2/mods-available/php7.conf /etc/apache2/mods-enabled/php7.conf
rm /etc/apache2/mods-enabled/php5.load
sudo chmod og-w /usr/lib/apache2/modules
sudo chmod -R og-w /etc/apache2/
sudo chmod -R oga-w /var/lib/apache2/module/enabled_by_admin
php -v