Skip to content

Commit aaafbeb

Browse files
committed
* PHP - imagick & mcrypt fix.
1 parent 3695ced commit aaafbeb

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.env.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ USER_CONFIG_PATH=./user
4444
# Debian OS available versions: jessie, stretch, buster, bullseye
4545
DEBIAN_VERSION=bullseye
4646

47-
# PHP available versions: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.1
47+
# PHP available versions: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1
4848
PHP_VERSION=8.1
4949

5050
# Nginx settings

commands/start.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,18 @@ func doNginxBuild() {
198198
func doPhpBuild() {
199199
util.Copy("config/php/Dockerfile.build", "config/php/Dockerfile")
200200

201-
packageList := []string{"symfony-cli", "gnupg1", "openssl", "git", "unzip", "libzip-dev", "nano", "libpng-dev", "libmagickwand-dev", "curl", "openssh-client", "less", "inkscape", "cron", "exiftool", "libicu-dev", "libmcrypt-dev", "libc-client-dev", "libkrb5-dev", "libssl-dev", "libxslt1-dev", "bash-completion"}
201+
packageList := []string{"gnupg1", "openssl", "git", "unzip", "libzip-dev", "nano", "libpng-dev", "libmagickwand-dev", "curl", "openssh-client", "less", "inkscape", "cron", "exiftool", "libicu-dev", "libmcrypt-dev", "libc-client-dev", "libkrb5-dev", "libssl-dev", "libxslt1-dev", "bash-completion"}
202202
peclInstall := []string{}
203203
phpExtInstall := []string{"pdo", "pdo_mysql", "opcache", "zip", "gd", "mysqli", "exif", "bcmath", "calendar", "intl", "soap", "imap", "sockets", "xsl"}
204204
phpExtEnable := []string{"mysqli", "calendar", "exif", "bcmath"}
205205
npmInstallGlobal := []string{}
206206

207-
if os.Getenv("PHP_VERSION") != "8.0" && os.Getenv("PHP_VERSION") != "8.1" {
208-
phpExtInstall = append(phpExtInstall, "imagick")
207+
if os.Getenv("PHP_VERSION") != "5.6" && os.Getenv("PHP_VERSION") != "7.0" && os.Getenv("PHP_VERSION") != "7.1" {
208+
packageList = append(packageList, "symfony-cli")
209+
}
210+
211+
if os.Getenv("PHP_VERSION") != "8.2" {
212+
peclInstall = append(peclInstall, "imagick")
209213
phpExtEnable = append(phpExtEnable, "imagick")
210214
util.Sed("__IMAGICK__", "", "config/php/Dockerfile")
211215
}
@@ -219,11 +223,16 @@ func doPhpBuild() {
219223
phpExtEnable = append(phpExtEnable, "apcu")
220224
}
221225

222-
if os.Getenv("PHP_VERSION") == "5.6" || os.Getenv("PHP_VERSION") == "7.0" || os.Getenv("PHP_VERSION") == "7.1" || os.Getenv("PHP_VERSION") == "7.2" || os.Getenv("PHP_VERSION") == "7.3" || os.Getenv("PHP_VERSION") == "7.4" {
226+
if os.Getenv("PHP_VERSION") == "5.6" || os.Getenv("PHP_VERSION") == "7.0" || os.Getenv("PHP_VERSION") == "7.1" {
223227
phpExtInstall = append(phpExtInstall, "mcrypt")
224228
phpExtEnable = append(phpExtEnable, "mcrypt")
225229
}
226230

231+
if os.Getenv("PHP_VERSION") == "7.2" || os.Getenv("PHP_VERSION") == "7.3" || os.Getenv("PHP_VERSION") == "7.4" || os.Getenv("PHP_VERSION") == "8.0" || os.Getenv("PHP_VERSION") == "8.1" {
232+
peclInstall = append(peclInstall, "mcrypt")
233+
phpExtEnable = append(phpExtEnable, "mcrypt")
234+
}
235+
227236
if os.Getenv("PHP_VERSION") == "7.4" {
228237
util.Sed("docker-php-ext-configure zip --with-libzip && ", "", "config/php/Dockerfile")
229238
util.Sed("docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && ", "docker-php-ext-configure gd --with-freetype --with-jpeg && ", "config/php/Dockerfile")
@@ -333,6 +342,12 @@ func doPhpBuild() {
333342
util.Sed("__NPM_INSTALL_GLOBAL__", strings.Join(npmInstallGlobal, " "), "config/php/Dockerfile")
334343
util.Sed("__CLEANUP__", "&& apt-get clean && rm -rf /var/lib/apt/lists/*", "config/php/Dockerfile")
335344

345+
if os.Getenv("PHP_VERSION") != "5.6" && os.Getenv("PHP_VERSION") != "7.0" && os.Getenv("PHP_VERSION") != "7.1" {
346+
util.Sed("__SYMFONY_CLI__", "echo \"deb [trusted=yes] https://repo.symfony.com/apt/ /\" | tee /etc/apt/sources.list.d/symfony-cli.list && \\", "config/php/Dockerfile")
347+
} else {
348+
util.Sed("__SYMFONY_CLI__", "\\", "config/php/Dockerfile")
349+
}
350+
336351
util.Sed(" \n", "", "config/php/Dockerfile")
337352
}
338353

config/php/Dockerfile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG WKHTMLTOPDF_VERSION
2525

2626
MAINTAINER Vasilij Dusko <[email protected]>
2727

28-
RUN echo "deb [trusted=yes] https://repo.symfony.com/apt/ /" | tee /etc/apt/sources.list.d/symfony-cli.list && \
28+
RUN __SYMFONY_CLI__
2929
apt-get update && \
3030
apt-get install --no-install-recommends --no-install-suggests -y \
3131
__PACKAGE_LIST__ \

0 commit comments

Comments
 (0)