Skip to content

Commit 046fe69

Browse files
committed
fix:8.2.16 Install gd configure: error: unrecognized options: --with-freetype-dir, --with-jpeg-dir
1 parent 85e7de1 commit 046fe69

3 files changed

Lines changed: 45 additions & 13 deletions

File tree

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
#FROM php:7.4.33-cli-alpine
22
# FROM php:8.1.24-cli
3-
# FROM php:8.2.16-cli-alpine
4-
FROM php:8.3.3-cli-alpine
3+
FROM php:8.2.16-cli-alpine
4+
# FROM php:8.3.3-cli-alpine
55

66
LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
7-
Description="Webman Lightweight container with PHP 8.2.11 based on Alpine Linux."
7+
Description="Webman Lightweight container with PHP 8.2.16 based on Alpine Linux."
88

99
# Container package : mirrors.163.com、mirrors.aliyun.com、mirrors.ustc.edu.cn
10-
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
10+
# RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
11+
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" /etc/apk/repositories
1112

1213
RUN cat /etc/issue
1314

14-
# Add basics first
15+
# [php74] Add basics first
1516
RUN apk update && apk add bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg-turbo-dev libpng-dev freetype-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
1617

17-
# RUN apt-get update && apt-get upgrade && apt-get install bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg-turbo-dev libpng-dev freetype-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev openssl-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
18+
# [php8] Add basics first
19+
# RUN apt-get update && apt-get upgrade && apt-get install bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg62-turbo-dev libpng12-dev libfreetype6-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev openssl-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
1820

1921
COPY ./extension /tmp/extension
2022
WORKDIR /tmp/extension

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ delete all images
103103
docker rmi -f $(docker images -qa)
104104
```
105105

106-
107-
108-
109106
## dos2unix install.sh
110107

111108
```
@@ -150,4 +147,36 @@ export EXTENSIONS="gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcn
150147
# Param 2: Specific PHP Minor version^M$
151148
# Return : 1 if greater than or equal to, 0 if less than^M$
152149
```
153-
> dos2unix install.sh 转换
150+
151+
执行转换
152+
```
153+
# 安装
154+
sudo apt-get install dos2unix
155+
156+
# 转换
157+
dos2unix install.sh
158+
```
159+
160+
161+
## Install gd
162+
```
163+
---------- Install gd ----------
164+
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
165+
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
166+
(1/6) Installing libsharpyuv (1.3.2-r0)
167+
(2/6) Installing libwebp (1.3.2-r0)
168+
(3/6) Installing libwebpdecoder (1.3.2-r0)
169+
(4/6) Installing libwebpdemux (1.3.2-r0)
170+
(5/6) Installing libwebpmux (1.3.2-r0)
171+
(6/6) Installing libwebp-dev (1.3.2-r0)
172+
OK: 404 MiB in 151 packages
173+
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
174+
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
175+
(1/1) Installing .phpize-deps-configure (20240305.013922)
176+
OK: 404 MiB in 152 packages
177+
Configuring for:
178+
PHP Api Version: 20220829
179+
Zend Module Api No: 20220829
180+
Zend Extension Api No: 420220829
181+
configure: error: unrecognized options: --with-freetype-dir, --with-jpeg-dir
182+
```

extension/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ echo "Work directory : ${PWD}"
99
echo "============================================"
1010
echo
1111

12-
export EXTENSIONS="gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcntl,sockets,amqp,zip,soap,event,"
12+
export EXTENSIONS=",gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcntl,sockets,zip,event,"
1313

1414
#
1515
# Check if current php version is greater than or equal to
@@ -195,8 +195,8 @@ if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
195195
libjpeg-turbo \
196196
libjpeg-turbo-dev \
197197
libwebp-dev \
198-
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
199-
&& docker-php-ext-install ${MC} gd \
198+
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
199+
&& docker-php-ext-install gd \
200200
&& apk del \
201201
freetype-dev \
202202
libpng-dev \
@@ -680,3 +680,4 @@ if [ "${PHP_EXTENSIONS}" != "" ]; then
680680
apk del .build-deps &&
681681
docker-php-source delete
682682
fi
683+

0 commit comments

Comments
 (0)