Skip to content

Commit

Permalink
fix:8.2.16 Install gd configure: error: unrecognized options: --with-…
Browse files Browse the repository at this point in the history
…freetype-dir, --with-jpeg-dir
  • Loading branch information
Tinywan committed Mar 5, 2024
1 parent 85e7de1 commit 046fe69
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 13 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#FROM php:7.4.33-cli-alpine
# FROM php:8.1.24-cli
# FROM php:8.2.16-cli-alpine
FROM php:8.3.3-cli-alpine
FROM php:8.2.16-cli-alpine
# FROM php:8.3.3-cli-alpine

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

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

RUN cat /etc/issue

# Add basics first
# [php74] Add basics first
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

# 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
# [php8] Add basics first
# 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

COPY ./extension /tmp/extension
WORKDIR /tmp/extension
Expand Down
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ delete all images
docker rmi -f $(docker images -qa)
```




## dos2unix install.sh

```
Expand Down Expand Up @@ -150,4 +147,36 @@ export EXTENSIONS="gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcn
# Param 2: Specific PHP Minor version^M$
# Return : 1 if greater than or equal to, 0 if less than^M$
```
> dos2unix install.sh 转换

执行转换
```
# 安装
sudo apt-get install dos2unix
# 转换
dos2unix install.sh
```


## Install gd
```
---------- Install gd ----------
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
(1/6) Installing libsharpyuv (1.3.2-r0)
(2/6) Installing libwebp (1.3.2-r0)
(3/6) Installing libwebpdecoder (1.3.2-r0)
(4/6) Installing libwebpdemux (1.3.2-r0)
(5/6) Installing libwebpmux (1.3.2-r0)
(6/6) Installing libwebp-dev (1.3.2-r0)
OK: 404 MiB in 151 packages
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
fetch https://mirrors.ustc.edu.cn/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
(1/1) Installing .phpize-deps-configure (20240305.013922)
OK: 404 MiB in 152 packages
Configuring for:
PHP Api Version: 20220829
Zend Module Api No: 20220829
Zend Extension Api No: 420220829
configure: error: unrecognized options: --with-freetype-dir, --with-jpeg-dir
```
7 changes: 4 additions & 3 deletions extension/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "Work directory : ${PWD}"
echo "============================================"
echo

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

#
# Check if current php version is greater than or equal to
Expand Down Expand Up @@ -195,8 +195,8 @@ if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
libjpeg-turbo \
libjpeg-turbo-dev \
libwebp-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install ${MC} gd \
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install gd \
&& apk del \
freetype-dev \
libpng-dev \
Expand Down Expand Up @@ -680,3 +680,4 @@ if [ "${PHP_EXTENSIONS}" != "" ]; then
apk del .build-deps &&
docker-php-source delete
fi

0 comments on commit 046fe69

Please sign in to comment.