-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_php.sh
executable file
·86 lines (72 loc) · 2.24 KB
/
install_php.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
#!/bin/sh
apk add bzip2 file re2c freetds freetype icu libintl libldap libjpeg libmcrypt libpng libpq libwebp libzip
TMP="autoconf \
bzip2-dev \
freetds-dev \
freetype-dev \
g++ \
gcc \
gettext-dev \
icu-dev \
jpeg-dev \
libmcrypt-dev \
libpng-dev \
libwebp-dev \
libxml2-dev \
libzip-dev \
make \
openldap-dev \
postgresql-dev"
apk add $TMP
# Configure extensions
docker-php-ext-configure gd --with-jpeg-dir=usr/ --with-freetype-dir=usr/ --with-webp-dir=usr/
docker-php-ext-configure ldap --with-libdir=lib/
docker-php-ext-configure pdo_dblib --with-libdir=lib/
# Download mongo extension
cd /tmp && \
git clone https://github.com/mongodb/mongo-php-driver.git && \
cd mongo-php-driver && \
git submodule update --init && \
phpize && \
./configure && \
make all && \
make install && \
echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini && \
echo "extension=pdo_sqlite.so" > /usr/local/etc/php/conf.d/sqlite3.ini && \
rm -rf /tmp/mongo-php-driver
#echo "PHP Path:"
#ls /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
#echo "END PHP Path"
docker-php-ext-install \
bz2 \
exif \
gd \
gettext \
intl \
ldap \
pdo_dblib \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
xmlrpc \
zip
docker-php-ext-enable pdo_sqlite
echo "PHP Path:"
ls /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
echo "END PHP Path"
# Download trusted certs
mkdir -p /etc/ssl/certs && update-ca-certificates
# Install composer
cd /tmp && php -r "readfile('https://getcomposer.org/installer');" | php && \
mv composer.phar /usr/bin/composer && \
chmod +x /usr/bin/composer
# Install Xdebug
curl -sSL -o /tmp/xdebug-${XDEBUG_VERSION}.tgz http://xdebug.org/files/xdebug-${XDEBUG_VERSION}.tgz
cd /tmp && tar -xzf xdebug-${XDEBUG_VERSION}.tgz && cd xdebug-${XDEBUG_VERSION} && phpize && ./configure && make && make install
echo "zend_extension=xdebug" > /usr/local/etc/php/conf.d/xdebug.ini
rm -rf /tmp/xdebug*
apk del $TMP
# Install PHPUnit
curl -sSL -o /usr/bin/phpunit https://phar.phpunit.de/phpunit.phar && chmod +x /usr/bin/phpunit
# Set timezone
# RUN echo America/Maceio > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata