-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_env.sh
39 lines (31 loc) · 1.7 KB
/
setup_env.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
#/bin/bash
set -e
#################################################################
#instal if necessary
#################################################################
#
#wget https://getcomposer.org/download/1.6.3/composer.phar
#mv composer.phar /usr/bin/composer
#chmod +x /usr/bin/composer
#
#wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
#echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
#
#apt-get update
#apt-get install php7.2-cli php7.2-dev php-pear php7.2-xdebug --yes
#curl -sL https://deb.nodesource.com/setup_9.x | bash -
#apt-get install nodejs
#
#################################################################
apt-get update
apt-get install apt-transport-https software-properties-common lsb-release ca-certificates g++ autoconf automake libtool make gcc curl git unzip libz-dev --yes
cd /tmp && git clone -b v1.16.0 https://github.com/grpc/grpc
(cd /tmp/grpc/ && git submodule update --init && make grpc_php_plugin)
sudo cp /tmp/grpc/bins/opt/grpc_php_plugin /usr/local/bin/grpc_php_plugin
(cd /tmp/grpc/third_party/protobuf/php/ext/google/protobuf && phpize && ./configure && make && sudo make install)
cp /tmp/grpc/third_party/protobuf/php/ext/google/protobuf/.libs/protobuf.so /usr/lib/php/20170718/
bash -c "echo extension=protobuf.so > /etc/php/7.2/cli/conf.d/30-protobuf.ini"
(cd /tmp/grpc/third_party/protobuf && ./autogen.sh && ./configure && make && sudo make install && ldconfig)
(cd /tmp/grpc && git submodule update --init && make && sudo make install)
(cd /tmp/grpc/src/php/ext/grpc && phpize && ./configure && make && sudo make install)
bash -c 'echo "extension=grpc.so" > /etc/php/7.2/cli/conf.d/10-grpc.ini'