Skip to content

Commit

Permalink
fix: 改用 php 生成 php73 php74
Browse files Browse the repository at this point in the history
  • Loading branch information
11ze committed Nov 20, 2023
1 parent dd6ef06 commit afdf98a
Show file tree
Hide file tree
Showing 42 changed files with 178 additions and 88 deletions.
Binary file added services/php73/extensions/amqp-1.10.2.tgz
Binary file not shown.
Binary file removed services/php73/extensions/amqp-1.11.0.tgz
Binary file not shown.
Binary file removed services/php73/extensions/apcu-4.0.8.tgz
Binary file not shown.
Binary file added services/php73/extensions/apcu-5.1.17.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions services/php73/extensions/install-composer.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

# The latest mirror's composer version only support for PHP 5.6.0
# The latest mirror's composer version only support for PHP 7.2.5
# And if your PHP version is lesser than that, will be download supported version.
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '5.6.0', '>');")
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '7.2.5', '>');")

if [ "$supportLatest" -eq "1" ]; then
curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
Expand All @@ -13,4 +13,4 @@ else
&& mv /tmp/composer.phar /usr/bin/composer \
&& chmod +x /usr/bin/composer \
&& rm -rf /tmp/composer-setup.php
fi
fi
125 changes: 85 additions & 40 deletions services/php73/extensions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export EXTENSIONS=",${PHP_EXTENSIONS},"
# specific version.
#
# For example, to check if current php is greater than or
# equal to PHP 5.6:
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 5 6
# isPhpVersionGreaterOrEqual 7 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
Expand Down Expand Up @@ -326,9 +326,9 @@ fi

if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then
echo "---------- Install imap ----------"
apk add --no-cache imap-dev
apk add --no-cache imap-dev
docker-php-ext-configure imap --with-imap --with-imap-ssl
docker-php-ext-install ${MC} imap
docker-php-ext-install ${MC} imap
fi

if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then
Expand Down Expand Up @@ -378,61 +378,61 @@ fi


if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install ssh2 ----------"
printf "\n" | apk add libssh2-dev
pecl install ssh2-1.1.2
docker-php-ext-enable ssh2
else
echo "ssh2 requires PHP >= 5.6.0, installed version is ${PHP_VERSION}"
echo "ssh2 requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi

if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install protobuf ----------"
printf "\n" | pecl install protobuf
docker-php-ext-enable protobuf
else
echo "yar requires PHP >= 5.6.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi

if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
docker-php-ext-enable yac
else
echo "yar requires PHP >= 5.6.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi

if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yar ----------"
printf "\n" | pecl install yar
docker-php-ext-enable yar
else
echo "yar requires PHP >= 5.6.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi

fi



if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
docker-php-ext-enable yaconf
else
echo "yar requires PHP >= 5.6.0, installed version is ${PHP_VERSION}"
echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}"
fi
fi

Expand Down Expand Up @@ -471,12 +471,12 @@ if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then
printf "\n" | pecl install sqlsrv
docker-php-ext-enable sqlsrv
else
echo "sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}"
fi
fi

if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev libmcrypt re2c
Expand All @@ -490,8 +490,14 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
fi

if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
else
echo "---------- Install mysql ----------"
docker-php-ext-install ${MC} mysql
fi
fi

if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then
Expand All @@ -510,39 +516,57 @@ fi
if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then
echo "---------- Install amqp ----------"
apk add --no-cache rabbitmq-c-dev
installExtensionFromTgz amqp-1.11.0
installExtensionFromTgz amqp-1.10.2
fi

if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 5 6
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-4.3.0
else
echo "redis requires PHP >= 5.6.0, installed version is ${PHP_VERSION}"
fi
installExtensionFromTgz redis-5.3.7
fi

if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then
echo "---------- Install apcu ----------"
installExtensionFromTgz apcu-4.0.8
installExtensionFromTgz apcu-5.1.17
fi

if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
printf "\n" | pecl install memcached-2.2.0
isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
else
printf "\n" | pecl install memcached-2.2.0
fi

docker-php-ext-enable memcached
fi

if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then
echo "---------- Install memcache ----------"
installExtensionFromTgz memcache-2.2.7
isPhpVersionGreaterOrEqual 7 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz memcache-4.0.5.2
else
installExtensionFromTgz memcache-2.2.6
fi
fi

if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then
echo "---------- Install xdebug ----------"
installExtensionFromTgz xdebug-2.5.5
isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" = "1" ]]; then
installExtensionFromTgz xdebug-2.9.2
else
installExtensionFromTgz xdebug-2.6.1
fi
else
installExtensionFromTgz xdebug-2.5.5
fi
fi

if [[ -z "${EXTENSIONS##*,event,*}" ]]; then
Expand All @@ -566,54 +590,75 @@ fi
if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then
echo "---------- Install mongodb ----------"
apk add --no-cache openssl-dev
installExtensionFromTgz mongodb-1.6.4=0
installExtensionFromTgz mongodb-1.7.4
docker-php-ext-configure mongodb --with-mongodb-ssl=openssl
fi

if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
echo "---------- Install yaf ----------"
installExtensionFromTgz yaf-3.0.9
isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
printf "\n" | pecl install yaf
docker-php-ext-enable yaf
else
installExtensionFromTgz yaf-2.3.5
fi
fi


if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
# Fix: Refer to the line containing "swoole@alpine)" in file "./install-php-extensions"
apk add --no-cache libstdc++
installExtensionFromTgz swoole-2.0.11 --enable-openssl

isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
installExtensionFromTgz swoole-4.8.11 --enable-openssl
else
installExtensionFromTgz swoole-2.0.11
fi
fi

if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
echo "---------- Install zip ----------"
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev

docker-php-ext-install ${MC} zip
isPhpVersionGreaterOrEqual 7 4
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi

docker-php-ext-install ${MC} zip
fi

if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
isPhpVersionGreaterOrEqual 5 6

isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-0.9.4.tgz -C xhprof --strip-components=1 \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 5.6----------"
echo "---------- PHP Version>= 7.0----------"
fi

fi

if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
docker-php-ext-enable xlswriter
else
echo "---------- PHP Version>= 5.6----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi

Expand All @@ -632,15 +677,15 @@ fi

if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then
echo "---------- Install zookeeper ----------"
isPhpVersionGreaterOrEqual 5 6
isPhpVersionGreaterOrEqual 7 0

if [[ "$?" = "1" ]]; then
apk add re2c
apk add libzookeeper-dev --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/testing/
printf "\n" | pecl install zookeeper
docker-php-ext-enable zookeeper
else
echo "---------- PHP Version>= 5.6----------"
echo "---------- PHP Version>= 7.0----------"
fi
fi

Expand Down
Binary file added services/php73/extensions/memcache-2.2.6.tgz
Binary file not shown.
Binary file removed services/php73/extensions/memcache-2.2.7.tgz
Binary file not shown.
Binary file added services/php73/extensions/memcache-4.0.5.2.tgz
Binary file not shown.
Binary file removed services/php73/extensions/mongodb-1.6.0.tgz
Binary file not shown.
Binary file added services/php73/extensions/mongodb-1.7.4.tgz
Binary file not shown.
Binary file removed services/php73/extensions/redis-4.3.0.tgz
Binary file not shown.
Binary file added services/php73/extensions/redis-5.3.7.tgz
Binary file not shown.
Binary file added services/php73/extensions/swoole-4.8.11.tgz
Binary file not shown.
Binary file added services/php73/extensions/xdebug-2.6.1.tgz
Binary file not shown.
Binary file added services/php73/extensions/xdebug-2.9.2.tgz
Binary file not shown.
Binary file removed services/php73/extensions/xhprof-0.9.4.tgz
Binary file not shown.
Binary file added services/php73/extensions/xhprof-2.2.0.tgz
Binary file not shown.
Binary file added services/php73/extensions/yaf-2.3.5.tgz
Binary file not shown.
Binary file removed services/php73/extensions/yaf-3.0.9.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion services/php73/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1923,7 +1923,7 @@ xdebug.remote_handler = "dbgp"
; Set to host.docker.internal on Mac and Windows, otherwise, set to host real ip
xdebug.remote_host = host.docker.internal
;xdebug.remote_port = 9000
xdebug.remote_log = /var/log/php/xdebug2.log
xdebug.remote_log = /var/log/php/xdebug.log

SERVER_ENV=develop

Expand Down
Binary file added services/php74/extensions/amqp-1.10.2.tgz
Binary file not shown.
Binary file removed services/php74/extensions/amqp-1.11.0.tgz
Binary file not shown.
Binary file removed services/php74/extensions/apcu-4.0.8.tgz
Binary file not shown.
Binary file added services/php74/extensions/apcu-5.1.17.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions services/php74/extensions/install-composer.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

# The latest mirror's composer version only support for PHP 5.6.0
# The latest mirror's composer version only support for PHP 7.2.5
# And if your PHP version is lesser than that, will be download supported version.
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '5.6.0', '>');")
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '7.2.5', '>');")

if [ "$supportLatest" -eq "1" ]; then
curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
Expand All @@ -13,4 +13,4 @@ else
&& mv /tmp/composer.phar /usr/bin/composer \
&& chmod +x /usr/bin/composer \
&& rm -rf /tmp/composer-setup.php
fi
fi
Loading

0 comments on commit afdf98a

Please sign in to comment.