-
Notifications
You must be signed in to change notification settings - Fork 4
/
aws-ec2-rhel8-php74-fpm-server.sh
executable file
·130 lines (110 loc) · 3.93 KB
/
aws-ec2-rhel8-php74-fpm-server.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/bash
yum update -y
yum install gcc gcc-c++ make python3-docutils -y
cd ~
wget https://github.com/skvadrik/re2c/releases/download/1.1.1/re2c-1.1.1.tar.gz
tar zxvf re2c-1.1.1.tar.gz
cd re2c-1.1.1
./configure --prefix=/opt/SP/re2c --enable-docs
make clean && make && make install
echo 'export PATH=$PATH:/opt/SP/re2c/bin' >> ~/.bash_profile
cd ~
source .bash_profile
cd ~
wget https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3.tar.gz
tar zxvf cmake-3.13.3.tar.gz
cd cmake-3.13.3
./bootstrap
make clean && make && make DESTDIR=/opt/SP/cmake install
echo 'export PATH=$PATH:/opt/SP/cmake/usr/local/bin' >> ~/.bash_profile
cd ~
source .bash_profile
yum install zlib-devel -y
cd ~
wget https://libzip.org/download/libzip-1.5.1.tar.xz
tar xf libzip-1.5.1.tar.xz
cd libzip-1.5.1
mkdir build
cd build
/opt/SP/cmake/usr/local/bin/cmake ..
make && make test && make install
echo "/usr/local/lib64" >> /etc/ld.so.conf
ldconfig
yum install libaio-devel m4 -y
cd ~
wget https://ftp.gnu.org/gnu/bison/bison-3.5.tar.gz
tar -zxvf bison-3.5.tar.gz
cd bison-3.5
./configure --prefix=/opt/SP/bison-3.5
make clean && make && make install
ln -s /opt/SP/bison-3.5 /opt/SP/bison
echo 'export PATH=$PATH:/opt/SP/bison/bin' >> ~/.bash_profile
cd ~
source .bash_profile
yum install autoconf bzip2-devel curl-devel libpng-devel libzip-devel libzip libxml2-devel openldap-devel gnutls-devel libicu-devel openssl-devel systemd-devel sqlite-devel oniguruma-devel -y
cd ~
wget https://www.php.net/distributions/php-7.4.9.tar.gz
tar -zxvf php-7.4.9.tar.gz
cd php-7.4.9
./buildconf --force
./configure --prefix=/opt/SP/php-7.4.9 \
--enable-fpm \
--with-pear \
--with-fpm-systemd \
--with-zlib \
--with-bz2 \
--with-curl \
--with-openssl \
--with-ldap \
--with-libdir=lib64 \
--enable-mbstring \
--enable-sockets \
--enable-bcmath \
--quiet
make clean && make && make install
ln -s /opt/SP/php-7.4.9 /opt/SP/php7
echo 'export PATH=$PATH:/opt/SP/php7/bin' >> ~/.bash_profile
echo 'export PATH=$PATH:/opt/SP/php7/bin' >> ~/.bash_profile
echo 'export PHP_HOME=/opt/SP/php7' >> ~/.bash_profile
echo 'export PHP_INI_SCAN_DIR=/opt/SP/php7/etc' >> ~/.bash_profile
cd ~
source .bash_profile
## ORACLE ###
cd /opt/SP/php-7.4.9/bin
./pecl channel-update pecl.php.net
printf "instantclient,/opt/SP/instantclient_12_1\n" | ./pecl install oci8-2.2.0
ln -s /opt/SP/instantclient_12_1/libclntsh.so.12.1 /opt/SP/instantclient_12_1/libclntsh.so
echo "extension=oci8.so" >> /opt/SP/php-7.4.9/etc/php.ini
##
rm -f /opt/SP/php-7.4.9/etc/php-fpm.conf.default
rm -f /opt/SP/php-7.4.9/etc/php-fpm.d/www.conf.default
mkdir /opt/SP/php-7.4.9/log
chown wwwrun:www /opt/SP/php-7.4.9/log
chmod +s /opt/SP/php-7.4.9/log
rm -f /opt/SP/php-7.4.9/etc/php.ini
cp ~/aws-ec2-install-scripts/config/php.ini /opt/SP/php-7.4.9/etc
chown root:root /opt/SP/php-7.4.9/etc/php.ini
chmod 644 /opt/SP/php-7.4.9/etc/php.ini
rm -f /opt/SP/php-7.4.9/etc/php-fpm.conf
cp ~/aws-ec2-install-scripts/config/php-fpm.conf /opt/SP/php-7.4.9/etc
chown root:root /opt/SP/php-7.4.9/etc/php-fpm.conf
chmod 644 /opt/SP/php-7.4.9/etc/php-fpm.conf
rm -f /opt/SP/php-7.4.9/etc/php-fpm.d/www.conf
cp ~/aws-ec2-install-scripts/config/www.conf /opt/SP/php-7.4.9/etc/php-fpm.d
chown root:root /opt/SP/php-7.4.9/etc/php-fpm.d/www.conf
chmod 644 /opt/SP/php-7.4.9/etc/php-fpm.d/www.conf
cp ~/aws-ec2-install-scripts/assets/services/php /etc/init.d
chown root:root /etc/init.d/php
chmod 611 /etc/init.d/php
chkconfig php on
service php start
netstat -antup | grep -i 9000
yum remove gcc gcc-c++ make python3-docutils bzip2-devel curl-devel libpng-devel libzip-devel libxml2-devel openldap-devel gnutls-devel libicu-devel openssl-devel systemd-devel zlib-devel libaio-devel sqlite-devel oniguruma-devel -y
rm -f /root/cmake-3.13.3.tar.gz;
rm -f /root/php-7.4.9.tar.gz;
rm -f /root/re2c-1.1.1.tar.gz;
rm -f /root/libzip-1.5.1.tar.xz;
rm -f ~wwwadm/.bash_profile
cp ~/.bash_profile ~wwwadm/.bash_profile
chmod 644 ~wwwadm/.bash_profile
chown wwwadm:wwwadm ~wwwadm/.bash_profile