1
0
Fork 0

feat: 修改 PHP 运行环境配置

This commit is contained in:
zhengkunwang223 2024-09-25 14:28:38 +08:00 committed by CityFun
parent f71f402fbe
commit 4b728c93e0
5 changed files with 27 additions and 49 deletions

View File

@ -23,6 +23,7 @@ services:
- ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini
- ./supervisor/supervisor.d:/etc/supervisor.d - ./supervisor/supervisor.d:/etc/supervisor.d
- ./supervisor/log:/var/log/supervisor - ./supervisor/log:/var/log/supervisor
- ./composer:/tmp/composer
ports: ports:
- 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000 - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000
labels: labels:

View File

@ -87,31 +87,6 @@ install_extension_default() {
} }
install_gd() {
isPhpVersionGreaterOrEqual 8 0
if [ "$?" = "1" ]; then
# "--with-xxx-dir" was removed from php 7.4,
# issue: https://github.com/docker-library/php/issues/912
options="--with-freetype --with-jpeg --with-webp"
else
options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/"
fi
apt-get install -y \
libfreetype6 \
libfreetype6-dev \
libpng-dev \
libwebp-dev \
libjpeg-dev \
&& docker-php-ext-configure gd ${options} \
&& docker-php-ext-install ${MC} gd \
&& apt-get purge -y \
libfreetype6-dev \
libpng-dev \
&& apt-get autoremove -y
}
install_msg() { install_msg() {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "------ install $1 succeeded ------" echo "------ install $1 succeeded ------"
@ -152,7 +127,7 @@ install_extension() {
echo "------ install extension: $extension ------" echo "------ install extension: $extension ------"
if [ "$extension" = "gd" ]; then if [ "$extension" = "gd" ]; then
install_gd install_php_extensions gd
elif [ "$extension" = "memcache" ]; then elif [ "$extension" = "memcache" ]; then
install_memcache install_memcache
elif [ "$extension" = "yaf" ]; then elif [ "$extension" = "yaf" ]; then

View File

@ -23,6 +23,7 @@ services:
- ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini
- ./supervisor/supervisor.d:/etc/supervisor.d - ./supervisor/supervisor.d:/etc/supervisor.d
- ./supervisor/log:/var/log/supervisor - ./supervisor/log:/var/log/supervisor
- ./composer:/tmp/composer
ports: ports:
- 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000 - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000
labels: labels:

View File

@ -88,28 +88,28 @@ install_extension_default() {
install_gd() { #install_gd() {
isPhpVersionGreaterOrEqual 8 0 # isPhpVersionGreaterOrEqual 8 0
if [ "$?" = "1" ]; then # if [ "$?" = "1" ]; then
# "--with-xxx-dir" was removed from php 7.4, # # "--with-xxx-dir" was removed from php 7.4,
# issue: https://github.com/docker-library/php/issues/912 # # issue: https://github.com/docker-library/php/issues/912
options="--with-freetype --with-jpeg --with-webp" # options="--with-freetype --with-jpeg --with-webp"
else # else
options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/" # options="--with-gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/"
fi # fi
apt-get install -y \ # apt-get install -y \
libfreetype6 \ # libfreetype6 \
libfreetype6-dev \ # libfreetype6-dev \
libpng-dev \ # libpng-dev \
libwebp-dev \ # libwebp-dev \
libjpeg-dev \ # libjpeg-dev \
&& docker-php-ext-configure gd ${options} \ # && docker-php-ext-configure gd ${options} \
&& docker-php-ext-install ${MC} gd \ # && docker-php-ext-install ${MC} gd \
&& apt-get purge -y \ # && apt-get purge -y \
libfreetype6-dev \ # libfreetype6-dev \
libpng-dev \ # libpng-dev \
&& apt-get autoremove -y # && apt-get autoremove -y
} #}
install_msg() { install_msg() {
@ -152,7 +152,7 @@ install_extension() {
echo "------ install extension: $extension ------" echo "------ install extension: $extension ------"
if [ "$extension" = "gd" ]; then if [ "$extension" = "gd" ]; then
install_gd install_php_extensions gd
elif [ "$extension" = "memcache" ]; then elif [ "$extension" = "memcache" ]; then
install_memcache install_memcache
elif [ "$extension" = "yaf" ]; then elif [ "$extension" = "yaf" ]; then

View File

@ -23,6 +23,7 @@ services:
- ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini - ./supervisor/supervisor.d/php-fpm.ini:/etc/supervisor.d/php-fpm.ini
- ./supervisor/supervisor.d:/etc/supervisor.d - ./supervisor/supervisor.d:/etc/supervisor.d
- ./supervisor/log:/var/log/supervisor - ./supervisor/log:/var/log/supervisor
- ./composer:/tmp/composer
ports: ports:
- 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000 - 127.0.0.1:${PANEL_APP_PORT_HTTP}:9000
labels: labels: