diff --git a/apps/list.json b/apps/list.json index 98eac0f2..72dadddb 100644 --- a/apps/list.json +++ b/apps/list.json @@ -46,7 +46,7 @@ "key": "openresty", "name": "OpenResty", "tags": ["Server"], - "versions": ["1.21.4"], + "versions": ["1.21.4.1"], "shortDescZh": "基于 NGINX 和 LuaJIT 的 Web 平台", "shortDescEn": "High performance web platform based on Nginx and LuaJIT", "type": "runtime", @@ -269,6 +269,51 @@ "website": "https://uptime.kuma.pet/", "github": "https://github.com/louislam/uptime-kuma", "document": "https://github.com/louislam/uptime-kuma/wiki" + }, + { + "key": "php5", + "name": "PHP 5", + "tags": ["Runtime"], + "versions": ["5.6.40"], + "shortDescZh": "PHP5 运行环境", + "shortDescEn": "PHP5 Runtime", + "type": "php", + "limit": 0, + "recommend": 9998, + "crossVersionUpdate": false, + "website": "https://www.php.net/", + "github": "https://github.com/php/php-src", + "document": "https://www.php.net/docs.php" + }, + { + "key": "php7", + "name": "PHP 7", + "tags": ["Runtime"], + "versions": ["7.4.33"], + "shortDescZh": "PHP7 运行环境", + "shortDescEn": "PHP7 Runtime", + "type": "php", + "limit": 0, + "recommend": 9997, + "crossVersionUpdate": false, + "website": "https://www.php.net/", + "github": "https://github.com/php/php-src", + "document": "https://www.php.net/docs.php" + }, + { + "key": "php8", + "name": "PHP 8", + "tags": ["Runtime"], + "versions": ["8.2.0"], + "shortDescZh": "PHP8 运行环境", + "shortDescEn": "PHP8 Runtime", + "type": "php", + "limit": 0, + "recommend": 9996, + "crossVersionUpdate": false, + "website": "https://www.php.net/", + "github": "https://github.com/php/php-src", + "document": "https://www.php.net/docs.php" } ] } diff --git a/apps/openresty/versions/1.21.4.1/conf/mime.types b/apps/openresty/versions/1.21.4.1/conf/mime.types new file mode 100644 index 00000000..065d8918 --- /dev/null +++ b/apps/openresty/versions/1.21.4.1/conf/mime.types @@ -0,0 +1,98 @@ +types { + text/html html htm shtml; + text/css css; + text/xml xml; + image/gif gif; + image/jpeg jpeg jpg; + application/javascript js; + application/atom+xml atom; + application/rss+xml rss; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/avif avif; + image/png png; + image/svg+xml svg svgz; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/webp webp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + + font/woff woff; + font/woff2 woff2; + + application/java-archive jar war ear; + application/json json; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.apple.mpegurl m3u8; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/vnd.ms-excel xls; + application/vnd.ms-fontobject eot; + application/vnd.ms-powerpoint ppt; + application/vnd.oasis.opendocument.graphics odg; + application/vnd.oasis.opendocument.presentation odp; + application/vnd.oasis.opendocument.spreadsheet ods; + application/vnd.oasis.opendocument.text odt; + application/vnd.openxmlformats-officedocument.presentationml.presentation + pptx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + xlsx; + application/vnd.openxmlformats-officedocument.wordprocessingml.document + docx; + application/vnd.wap.wmlc wmlc; + application/wasm wasm; + application/x-7z-compressed 7z; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/xhtml+xml xhtml; + application/xspf+xml xspf; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/ogg ogg; + audio/x-m4a m4a; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mp2t ts; + video/mp4 mp4; + video/mpeg mpeg mpg; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-m4v m4v; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; +} \ No newline at end of file diff --git a/apps/openresty/versions/1.21.4/conf/mime.types b/apps/openresty/versions/1.21.4/conf/mime.types deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/php5/metadata/logo.png b/apps/php5/metadata/logo.png new file mode 100644 index 00000000..569fc644 Binary files /dev/null and b/apps/php5/metadata/logo.png differ diff --git a/apps/php5/versions/5.6.40/README.md b/apps/php5/versions/5.6.40/README.md new file mode 100644 index 00000000..85cdf6c3 --- /dev/null +++ b/apps/php5/versions/5.6.40/README.md @@ -0,0 +1,141 @@ +
+ + PHP + +
+ +# The PHP Interpreter + +PHP is a popular general-purpose scripting language that is especially suited to +web development. Fast, flexible and pragmatic, PHP powers everything from your +blog to the most popular websites in the world. PHP is distributed under the +[PHP License v3.01](LICENSE). + +[![Push](https://github.com/php/php-src/actions/workflows/push.yml/badge.svg)](https://github.com/php/php-src/actions/workflows/push.yml) +[![Build status](https://travis-ci.com/php/php-src.svg?branch=master)](https://travis-ci.com/github/php/php-src) +[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy/branch/master?svg=true)](https://ci.appveyor.com/project/php/php-src) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/php.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:php) + +## Documentation + +The PHP manual is available at [php.net/docs](https://php.net/docs). + +## Installation + +### Prebuilt packages and binaries + +Prebuilt packages and binaries can be used to get up and running fast with PHP. + +For Windows, the PHP binaries can be obtained from +[windows.php.net](https://windows.php.net). After extracting the archive the +`*.exe` files are ready to use. + +For other systems, see the [installation chapter](https://php.net/install). + +### Building PHP source code + +*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).* + +For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For +a default build, you will additionally need libxml2 and libsqlite3. + +On Ubuntu, you can install these using: + + sudo apt install -y pkg-config build-essential autoconf bison re2c \ + libxml2-dev libsqlite3-dev + +On Fedora, you can install these using: + + sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel + +Generate configure: + + ./buildconf + +Configure your build. `--enable-debug` is recommended for development, see +`./configure --help` for a full list of options. + + # For development + ./configure --enable-debug + # For production + ./configure + +Build PHP. To speed up the build, specify the maximum number of jobs using `-j`: + + make -j4 + +The number of jobs should usually match the number of available cores, which +can be determined using `nproc`. + +## Testing PHP source code + +PHP ships with an extensive test suite, the command `make test` is used after +successful compilation of the sources to run this test suite. + +It is possible to run tests using multiple cores by setting `-jN` in +`TEST_PHP_ARGS`: + + make TEST_PHP_ARGS=-j4 test + +Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum +number of jobs should not exceed the number of cores available. + +The [qa.php.net](https://qa.php.net) site provides more detailed info about +testing and quality assurance. + +## Installing PHP built from source + +After a successful build (and test), PHP may be installed with: + + make install + +Depending on your permissions and prefix, `make install` may need super user +permissions. + +## PHP extensions + +Extensions provide additional functionality on top of PHP. PHP consists of many +essential bundled extensions. Additional extensions can be found in the PHP +Extension Community Library - [PECL](https://pecl.php.net). + +## Contributing + +The PHP source code is located in the Git repository at +[github.com/php/php-src](https://github.com/php/php-src). Contributions are most +welcome by forking the repository and sending a pull request. + +Discussions are done on GitHub, but depending on the topic can also be relayed +to the official PHP developer mailing list internals@lists.php.net. + +New features require an RFC and must be accepted by the developers. See +[Request for comments - RFC](https://wiki.php.net/rfc) and +[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information +on the process. + +Bug fixes don't require an RFC. If the bug has a GitHub issue, reference it in +the commit message using `GH-NNNNNN`. Use `#NNNNNN` for tickets in the old +[bugs.php.net](https://bugs.php.net) bug tracker. + + Fix GH-7815: php_uname doesn't recognise latest Windows versions + Fix #55371: get_magic_quotes_gpc() throws deprecation warning + +See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for details on how pull +requests are merged. + +### Guidelines for contributors + +See further documents in the repository for more information on how to +contribute: + +- [Contributing to PHP](/CONTRIBUTING.md) +- [PHP coding standards](/CODING_STANDARDS.md) +- [Mailing list rules](/docs/mailinglist-rules.md) +- [PHP release process](/docs/release-process.md) + +## Credits + +For the list of people who've put work into PHP, please see the +[PHP credits page](https://php.net/credits.php). diff --git a/apps/php5/versions/5.6.40/build/.env b/apps/php5/versions/5.6.40/build/.env new file mode 100644 index 00000000..c2804904 --- /dev/null +++ b/apps/php5/versions/5.6.40/build/.env @@ -0,0 +1,13 @@ +CONTAINER_PACKAGE_URL=mirrors.ustc.edu.cn + +PHP_VERSION=5.6.40 +PHP_PHP_CONF_FILE=./php/php.ini +PHP_FPM_CONF_FILE=./php/php-fpm.conf +PHP_LOG_DIR=./logs/php +PHP_EXTENSIONS= + +SOURCE_DIR=./www + +TZ=Asia/Shanghai +DATA_DIR=./data +IMAGE_NAME=1panel-php:5.6.40 \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/build/config.json b/apps/php5/versions/5.6.40/build/config.json new file mode 100644 index 00000000..eed3af6f --- /dev/null +++ b/apps/php5/versions/5.6.40/build/config.json @@ -0,0 +1,102 @@ +{ + "formFields": [ + { + "type": "select", + "multiple": true, + "labelZh": "扩展", + "labelEn": "Extensions", + "default": [], + "values": [ + { + "label": "opcache", + "value": "opcache" + }, + { + "label": "memcached", + "value": "memcached" + }, + { + "label": "memcache", + "value": "memcache" + }, + { + "label": "redis", + "value": "redis" + }, + { + "label": "mcrypt", + "value": "mcrypt" + }, + { + "label": "xdebug", + "value": "xdebug" + }, + { + "label": "imap", + "value": "imap" + }, + { + "label": "exif", + "value": "exif" + }, + { + "label": "intl", + "value": "intl" + }, + { + "label": "swoole", + "value": "swoole" + }, + { + "label": "yaf", + "value": "yaf" + }, + { + "label": "pgsql", + "value": "pgsql" + }, + { + "label": "pdo_pgsql", + "value": "pdo_pgsql" + }, + { + "label": "snmp", + "value": "snmp" + }, { + "label": "ldap", + "value": "ldap" + }, + { + "label": "pspell", + "value": "pspell" + }, + { + "label": "bz2", + "value": "bz2" + }, + { + "label": "sysvshm", + "value": "sysvshm" + }, + { + "label": "calendar", + "value": "calendar" + }, + { + "label": "gmp", + "value": "gmp" + }, + { + "label": "sysvmsg", + "value": "sysvmsg" + }, + { + "label": "igbinary", + "value": "igbinary" + } + ], + "envKey": "PHP_EXTENSIONS", + "edit": true + } + ] +} \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/build/docker-compose.yml b/apps/php5/versions/5.6.40/build/docker-compose.yml new file mode 100644 index 00000000..75246ffb --- /dev/null +++ b/apps/php5/versions/5.6.40/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3" +services: + 1panel-php: + build: + context: ./php + args: + PHP_IMAGE: php:${PHP_VERSION}-fpm-alpine + CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} + PHP_EXTENSIONS: ${PHP_EXTENSIONS} + TZ: ${TZ} + image: ${IMAGE_NAME} + volumes: + - ${SOURCE_DIR}:/www/ + - ${PHP_PHP_CONF_FILE}:/usr/local/etc/php/php.ini + - ${PHP_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf + - ${PHP_LOG_DIR}:/var/log/php + - ${DATA_DIR}/composer:/tmp/composer + restart: always + cap_add: + - SYS_PTRACE + networks: + - default \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/build/php/Dockerfile b/apps/php5/versions/5.6.40/build/php/Dockerfile new file mode 100644 index 00000000..fd4e547d --- /dev/null +++ b/apps/php5/versions/5.6.40/build/php/Dockerfile @@ -0,0 +1,41 @@ +ARG PHP_IMAGE +FROM ${PHP_IMAGE} + +ARG TZ +ARG PHP_EXTENSIONS +ARG CONTAINER_PACKAGE_URL + + +RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi + + +COPY ./extensions /tmp/extensions +WORKDIR /tmp/extensions +RUN chmod +x install.sh \ + && sh install.sh + +ADD ./extensions/install-php-extensions /usr/local/bin/ + +RUN chmod uga+x /usr/local/bin/install-php-extensions + +RUN apk --no-cache add tzdata \ + && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ + && echo "$TZ" > /etc/timezone + + +# Fix: https://github.com/docker-library/php/issues/1121 +RUN apk add --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/v3.13/community/ gnu-libiconv=1.15-r3 +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php + + +# Install composer and change it's cache home +RUN chmod +x install-composer.sh \ + && sh install-composer.sh \ + && rm -rf /tmp/extensions +ENV COMPOSER_HOME=/tmp/composer + +# php image's www-data user uid & gid are 82, change them to 1000 (primary user) +RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data + + +WORKDIR /www diff --git a/apps/php5/versions/5.6.40/build/php/extensions/install-composer.sh b/apps/php5/versions/5.6.40/build/php/extensions/install-composer.sh new file mode 100644 index 00000000..34074732 --- /dev/null +++ b/apps/php5/versions/5.6.40/build/php/extensions/install-composer.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# 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, '7.2.5', '>');") + +if [ "$supportLatest" -eq "1" ]; then + curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ + && chmod +x /usr/bin/composer +else + curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ + && php /tmp/composer-setup.php --install-dir=/tmp \ + && mv /tmp/composer.phar /usr/bin/composer \ + && chmod +x /usr/bin/composer \ + && rm -rf /tmp/composer-setup.php +fi \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/build/php/extensions/install-php-extensions b/apps/php5/versions/5.6.40/build/php/extensions/install-php-extensions new file mode 100644 index 00000000..72a75d9f --- /dev/null +++ b/apps/php5/versions/5.6.40/build/php/extensions/install-php-extensions @@ -0,0 +1,4093 @@ +#!/bin/sh + +# This script wraps docker-php-ext-install, properly configuring the system. +# +# Copyright (c) Michele Locati, 2018-2023 +# +# Source: https://github.com/mlocati/docker-php-extension-installer +# +# License: MIT - see https://github.com/mlocati/docker-php-extension-installer/blob/master/LICENSE + +# Let's set a sane environment +set -o errexit +set -o nounset + +if test "${IPE_DEBUG:-}" = "1"; then + set -x +fi + +if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable >/dev/null || ! which docker-php-ext-install >/dev/null || ! which docker-php-source >/dev/null; then + printf 'The script %s is meant to be used with official Docker PHP Images - https://hub.docker.com/_/php\n' "$0" >&2 + exit 1 +fi + +IPE_VERSION=master + +StandWithUkraine() { + if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then + printf '\e[37;44m#StandWith\e[30;43mUkraine\e[0m\n' + else + printf '#StandWithUkraine\n' + fi +} + +if test "$IPE_VERSION" = master && test "${CI:-}" != true; then + cat <&2 + exit 1 + fi + DISTRO="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)" + DISTRO_VERSION_NUMBER="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)" + DISTRO_VERSION="$(printf '%s@%s' $DISTRO $DISTRO_VERSION_NUMBER)" + DISTRO_MAJMIN_VERSION="$(echo "$DISTRO_VERSION_NUMBER" | awk -F. '{print $1*100+$2}')" +} + +# Set: +# - PHP_MAJMIN_VERSION: Major-Minor version, format MMmm (example 800 for PHP 8.0.1) +# - PHP_MAJDOTMIN_VERSION: Major-Minor version, format M.m (example 8.0 for PHP 8.0.1) +# - PHP_MAJMINPAT_VERSION: Major-Minor-Patch version, format MMmmpp (example 80001 for PHP 8.0.1) variables containing integers value +# - PHP_MAJDOTMINDOTPAT_VERSION: Major-Minor-Patch version, format M.m.p (example 8.0.1 for PHP 8.0.1) +# - PHP_THREADSAFE: 1 if PHP is thread-safe (TS), 0 if not thread-safe (NTS) +# - PHP_DEBUGBUILD: 1 if PHP is debug build (configured with "--enable-debug"), 0 otherwise +# - PHP_BITS: 32 if PHP is compiled for 32-bit, 64 if 64-bit +# - PHP_EXTDIR: the absolute path where the PHP extensions reside +setPHPVersionVariables() { + PHP_MAJDOTMINDOTPAT_VERSION="$(php-config --version)" + PHP_MAJMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*100+$2}') + PHP_MAJDOTMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | cut -d. -f1-2) + PHP_MAJMINPAT_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*10000+$2*100+$3}') + PHP_THREADSAFE=$(php -n -r 'echo ZEND_THREAD_SAFE ? 1 : 0;') + PHP_DEBUGBUILD=$(php -n -r 'echo ZEND_DEBUG_BUILD ? 1 : 0;') + PHP_BITS=$(php -n -r 'echo PHP_INT_SIZE * 8;') + PHP_EXTDIR="$(php -d display_errors=stderr -r 'echo realpath(ini_get("extension_dir"));')" +} + +# Fix apt-get being very slow on Debian Jessie +# See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1332440 +fixMaxOpenFiles() { + fixMaxOpenFiles_cur=$(ulimit -n 2>/dev/null || echo 0) + if test "$fixMaxOpenFiles_cur" -gt 10000; then + ulimit -n 10000 + fi +} + +# Get the directory containing the compiled PHP extensions +# +# Output: +# The absolute path of the extensions dir +getPHPExtensionsDir() { + php -i | grep -E '^extension_dir' | head -n1 | tr -s '[:space:]*=>[:space:]*' '|' | cut -d'|' -f2 +} + +# Normalize the name of a PHP extension +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The normalized module name +normalizePHPModuleName() { + normalizePHPModuleName_name="$1" + case "$normalizePHPModuleName_name" in + *A* | *B* | *C* | *D* | *E* | *F* | *G* | *H* | *I* | *J* | *K* | *L* | *M* | *N* | *O* | *P* | *Q* | *R* | *S* | *T* | *U* | *V* | *W* | *X* | *Y* | *Z*) + normalizePHPModuleName_name="$(LC_CTYPE=C printf '%s' "$normalizePHPModuleName_name" | tr '[:upper:]' '[:lower:]')" + ;; + esac + case "$normalizePHPModuleName_name" in + datadog_trace) + normalizePHPModuleName_name=ddtrace + ;; + ioncube | ioncube\ loader) + normalizePHPModuleName_name='ioncube_loader' + ;; + pecl_http) + normalizePHPModuleName_name='http' + ;; + zend\ opcache) + normalizePHPModuleName_name='opcache' + ;; + libsodium) + if test $PHP_MAJMIN_VERSION -ge 700; then + normalizePHPModuleName_name='sodium' + fi + ;; + sodium) + if test $PHP_MAJMIN_VERSION -lt 700; then + normalizePHPModuleName_name='libsodium' + fi + ;; + *\ *) + printf '### WARNING Unrecognized module name: %s ###\n' "$1" >&2 + ;; + esac + printf '%s' "$normalizePHPModuleName_name" +} + +# Get the PECL name of PHP extension +# +# Arguments: +# $1: the name of the extension +# +# Output: +# The PECL name of the extension +getPeclModuleName() { + normalizePHPModuleName_name="$1" + case "$normalizePHPModuleName_name" in + ddtrace) + normalizePHPModuleName_name=datadog_trace + ;; + http) + normalizePHPModuleName_name=pecl_http + ;; + sodium) + normalizePHPModuleName_name=libsodium + ;; + esac + printf '%s' "$normalizePHPModuleName_name" +} + +# Parse a package.xml (or package2.xml) file and extract the module name and version +# +# Arguments: +# $1: the patho to the XML file +# +# Set these variables: +# - EXTRACTPACKAGEVERSIONFROMXML_NAME +# - EXTRACTPACKAGEVERSIONFROMXML_VERSION +# +# Output: +# Nothing +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +extractPackageVersionFromXML() { + if ! test -f "$1"; then + printf 'Unable to find the file\n%s\n' >&2 + return 1 + fi + extractPackageVersionFromXML_code="$( + cat <<'EOT' +$doc = new DOMDocument(); +if (!$doc->load($argv[1])) { + fwrite(STDERR, "Failed to load XML file\n"); + exit(1); +} +set_error_handler( + static function($errno, $errstr) { + fwrite(STDERR, trim((string) $errstr) . "\n"); + exit(1); + }, + -1 +); +$xpath = new DOMXpath($doc); +$xpath->registerNamespace('v20', 'http://pear.php.net/dtd/package-2.0'); +$xpath->registerNamespace('v21', 'http://pear.php.net/dtd/package-2.1'); +if ($xpath->query('/v20:package/v20:dependencies')->length === 1) { + $ns = 'v20:'; +} elseif ($xpath->query('/v21:package/v21:dependencies')->length === 1) { + $ns = 'v21:'; +} elseif ($xpath->query('/package')->length === 1) { + $ns = ''; +} else { + fwrite(STDERR, "Unsupported namespace of the XML of package version details\n"); +} +$nodes = $xpath->query("/{$ns}package/{$ns}name"); +$name = trim((string) $nodes[0]->nodeValue); +if ($ns === '') { + $nodes = $xpath->query("/{$ns}package/{$ns}version"); +} else { + $nodes = $xpath->query("/{$ns}package/{$ns}version/{$ns}release"); +} +$version = trim((string) $nodes[0]->nodeValue); +echo "EXTRACTPACKAGEVERSIONFROMXML_NAME='{$name}'\n"; +echo "EXTRACTPACKAGEVERSIONFROMXML_VERSION='{$version}'\n"; +exit(0); +EOT + )" + extractPackageVersionFromXML_vars="$(php -n -d display_errors=stderr -r "$extractPackageVersionFromXML_code" "$1")" + if test -z "$extractPackageVersionFromXML_vars"; then + return 1 + fi + eval "$extractPackageVersionFromXML_vars" + return 0 +} + +# Parse a module name (and optionally version) as received via command arguments, extracting the version and normalizing it +# Examples: +# xdebug-2.9.8 +# xdebug-^2 +# xdebug-^2.9 +# +# Arguments: +# $1: the name of the module to be normalized +# +# Set these variables: +# - PROCESSED_PHP_MODULE_ARGUMENT +# +# Optionally set these variables: +# - PHP_WANTEDMODULEVERSION_<...> (where <...> is the normalized module name) +# - PHP_MODULESOURCECODEPATH_<...> (where <...> is the normalized module name) +# +# Output: +# Nothing +processPHPModuleArgument() { + processPHPModuleArgument_arg="$1" + # Convert GitHub short form to long url, + # for example: from + # php-memcached-dev/php-memcached@8f106564e6bb005ca6100b12ccc89000daafa9d8 + # to + # https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/8f106564e6bb005ca6100b12ccc89000daafa9d8 + processPHPModuleArgument_arg="$(printf '%s' "$processPHPModuleArgument_arg" | sed -E 's/^([a-zA-Z0-9_.\-]+\/[a-zA-Z0-9_.\-]+)@(.+$)/https:\/\/codeload.github.com\/\1\/tar.gz\/\2/')" + # Let's check if $processPHPModuleArgument_arg is an URL + if printf '%s' "$processPHPModuleArgument_arg" | grep -Eq '^https?://[^ ]+/[^ ]+$'; then + printf 'Downloading source from %s\n' "$processPHPModuleArgument_arg" + processPHPModuleArgument_arg="$(getPackageSource "$processPHPModuleArgument_arg")" + fi + # Let's check if $processPHPModuleArgument_arg the absolute path of an existing directory + if test "$processPHPModuleArgument_arg" != "${processPHPModuleArgument_arg#/}" && test -d "$processPHPModuleArgument_arg"; then + if test -f "$processPHPModuleArgument_arg/package2.xml"; then + printf 'Checking package2.xml of directory %s... ' "$processPHPModuleArgument_arg" + if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package2.xml"; then + return 1 + fi + elif test -f "$processPHPModuleArgument_arg/package.xml"; then + printf 'Checking package.xml of directory %s... ' "$processPHPModuleArgument_arg" + if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package.xml"; then + return 1 + fi + else + printf 'Unable to find the package.xml file in the directory\n%s\n' "$processPHPModuleArgument_arg" + return 1 + fi + printf 'good (name: %s, version: %s)\n' "$EXTRACTPACKAGEVERSIONFROMXML_NAME" "$EXTRACTPACKAGEVERSIONFROMXML_VERSION" + PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$EXTRACTPACKAGEVERSIONFROMXML_NAME")" + processPHPModuleArgument_version="$EXTRACTPACKAGEVERSIONFROMXML_VERSION" + if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval PHP_MODULESOURCECODEPATH_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_arg" + else + printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2 + exit 1 + fi + else + PROCESSED_PHP_MODULE_ARGUMENT="${processPHPModuleArgument_arg%%-*}" + if test -n "$PROCESSED_PHP_MODULE_ARGUMENT" && test "$PROCESSED_PHP_MODULE_ARGUMENT" != "$processPHPModuleArgument_arg"; then + processPHPModuleArgument_version="${processPHPModuleArgument_arg#*-}" + else + processPHPModuleArgument_version='' + fi + PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$PROCESSED_PHP_MODULE_ARGUMENT")" + fi + if test -n "$processPHPModuleArgument_version"; then + if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval PHP_WANTEDMODULEVERSION_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_version" + elif printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^@[a-zA-Z0-9_]+$'; then + eval PHP_WANTEDMODULEVERSION__${PROCESSED_PHP_MODULE_ARGUMENT#@}="$processPHPModuleArgument_version" + else + printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2 + fi + fi +} + +# Get the wanted PHP module version, as specified in the command line arguments. +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The wanted version (if any) +getWantedPHPModuleVersion() { + if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_WANTEDMODULEVERSION_$1:-}" + elif printf '%s' "$1" | grep -Eq '^@[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_WANTEDMODULEVERSION__${1#@}:-}" + fi +} + +# Get source code path of a PHP module version, as specified in the command line arguments. +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The wanted version (if any) +getModuleSourceCodePath() { + if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_MODULESOURCECODEPATH_$1:-}" + fi +} + +# Get the wanted PHP module version, resolving it if it starts with '^' +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The version to be used +resolveWantedPHPModuleVersion() { + resolveWantedPHPModuleVersion_raw="$(getWantedPHPModuleVersion "$1")" + resolveWantedPHPModuleVersion_afterCaret="${resolveWantedPHPModuleVersion_raw#^}" + if test "$resolveWantedPHPModuleVersion_raw" = "$resolveWantedPHPModuleVersion_afterCaret"; then + printf '%s' "$resolveWantedPHPModuleVersion_raw" + return + fi + resolveWantedPHPModuleVersion_xml="$(curl -sSLf "http://pecl.php.net/rest/r/$1/allreleases.xml")" + resolveWantedPHPModuleVersion_versions="$(printf '%s' "$resolveWantedPHPModuleVersion_xml" | tr -s ' \t\r\n' ' ' | sed -r 's# *<#\n<#g' | grep '' | sed 's###g' | sed 's# ##g')" + resetIFS + for resolveWantedPHPModuleVersion_version in $resolveWantedPHPModuleVersion_versions; do + resolveWantedPHPModuleVersion_suffix="${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret}" + if test "$resolveWantedPHPModuleVersion_version" != "${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret.}"; then + # Example: looking for 1.0, found 1.0.1 + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + fi + done + for resolveWantedPHPModuleVersion_version in $resolveWantedPHPModuleVersion_versions; do + resolveWantedPHPModuleVersion_suffix="${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret}" + if test "$resolveWantedPHPModuleVersion_version" = "$resolveWantedPHPModuleVersion_suffix"; then + continue + fi + if test -z "$resolveWantedPHPModuleVersion_suffix"; then + # Example: looking for 1.0, found exactly it + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + fi + case "$resolveWantedPHPModuleVersion_suffix" in + [0-9]) + # Example: looking for 1.1, but this is 1.10 + ;; + *) + # Example: looking for 1.1, this is 1.1rc1 + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + ;; + esac + done + printf 'Unable to find a version of "%s" compatible with "%s"\nAvailable versions are:\n%s\n' "$1" "$resolveWantedPHPModuleVersion_raw" "$resolveWantedPHPModuleVersion_versions" >&2 + exit 1 +} + +# Get the actual version of a PECL pmodule, resolving 'latest', 'stable', 'beta', 'alpha', 'devel'. +# +# Arguments: +# $1: the module name as known on the PECL archive +# $2: the version to be resolved +# Output: +# $2 itself if $1 is not 'latest', 'stable', 'beta', 'alpha', or 'devel', the actual version otherwise +resolvePeclStabilityVersion() { + case "$2" in + latest | stable | beta | alpha | devel) ;; + *) + printf '%s' "$2" + return + ;; + esac + peclStabilityFlagToVersion_url="http://pecl.php.net/rest/r/$1/$2.txt" + if ! peclStabilityFlagToVersion_result="$(curl -sSLf "$peclStabilityFlagToVersion_url")"; then + peclStabilityFlagToVersion_result='' + fi + if test -z "$peclStabilityFlagToVersion_result"; then + printf 'Failed to resolve the PECL package version "%s" of %s from %s\n' "$2" "$1" "$peclStabilityFlagToVersion_url" >&2 + exit 1 + fi + printf '%s' "$peclStabilityFlagToVersion_result" +} + +# Set these variables: +# - PHP_PREINSTALLED_MODULES the normalized list of PHP modules installed before running this script +setPHPPreinstalledModules() { + PHP_PREINSTALLED_MODULES='' + IFS=' +' + for getPHPInstalledModules_module in $(php -m); do + getPHPInstalledModules_moduleNormalized='' + case "$getPHPInstalledModules_module" in + \[PHP\ Modules\]) ;; + \[Zend\ Modules\]) + break + ;; + *) + getPHPInstalledModules_moduleNormalized="$(normalizePHPModuleName "$getPHPInstalledModules_module")" + if ! stringInList "$getPHPInstalledModules_moduleNormalized" "$PHP_PREINSTALLED_MODULES"; then + PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES $getPHPInstalledModules_moduleNormalized" + fi + ;; + esac + done + if command -v composer >/dev/null; then + PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES @composer" + fi + resetIFS + PHP_PREINSTALLED_MODULES="${PHP_PREINSTALLED_MODULES# }" +} + +# Get the handles of the modules to be installed +# +# Arguments: +# $@: all module handles +# +# Set: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +processCommandArguments() { + processCommandArguments_endArgs=0 + PHP_MODULES_TO_INSTALL='' + # Support deprecated flag IPE_FIX_CACERTS + case "${IPE_FIX_CACERTS:-}" in + 1 | y* | Y*) + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL @fix_letsencrypt" + ;; + esac + while :; do + if test $# -lt 1; then + break + fi + processCommandArguments_skip=0 + if test $processCommandArguments_endArgs -eq 0; then + case "$1" in + --cleanup) + printf '### WARNING the %s option is deprecated (we always cleanup everything) ###\n' "$1" >&2 + processCommandArguments_skip=1 + ;; + --) + processCommandArguments_skip=1 + processCommandArguments_endArgs=1 + ;; + -*) + printf 'Unrecognized option: %s\n' "$1" >&2 + exit 1 + ;; + esac + fi + if test $processCommandArguments_skip -eq 0; then + processPHPModuleArgument "$1" + processCommandArguments_name="$PROCESSED_PHP_MODULE_ARGUMENT" + if stringInList "$processCommandArguments_name" "$PHP_MODULES_TO_INSTALL"; then + printf '### WARNING Duplicated module name specified: %s ###\n' "$processCommandArguments_name" >&2 + elif stringInList "$processCommandArguments_name" "$PHP_PREINSTALLED_MODULES"; then + printf '### WARNING Module already installed: %s ###\n' "$processCommandArguments_name" >&2 + else + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $processCommandArguments_name" + fi + fi + shift + done + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }" +} + +# Add a module that's required by another module +# +# Arguments: +# $1: module that requires another module +# $2: the required module +# +# Update: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +checkRequiredModule() { + if ! stringInList "$1" "$PHP_MODULES_TO_INSTALL"; then + return + fi + if stringInList "$2" "$PHP_PREINSTALLED_MODULES"; then + return + fi + PHP_MODULES_TO_INSTALL="$(removeStringFromList "$1" "$PHP_MODULES_TO_INSTALL")" + if ! stringInList "$2" "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $2" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }" + fi + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $1" +} + +# Sort the modules to be installed, in order to fix dependencies +# +# Update: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +sortModulesToInstall() { + # apcu_bc requires apcu + checkRequiredModule 'apcu_bc' 'apcu' + # http requires propro (for PHP < 8) and raphf + if test $PHP_MAJMIN_VERSION -le 704; then + checkRequiredModule 'http' 'propro' + fi + checkRequiredModule 'http' 'raphf' + # event requires sockets (for PHP <= 5.6) + if test $PHP_MAJMIN_VERSION -le 506; then + checkRequiredModule event sockets + fi + # relay requires msgpack + checkRequiredModule relay msgpack + # relay requires igbinary + checkRequiredModule relay igbinary + # Some module installation may use sockets if available: move it before other modules + if stringInList 'sockets' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'sockets' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="sockets $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use igbinary if available: move it before other modules + if stringInList 'igbinary' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'igbinary' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="igbinary $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use msgpack if available: move it before other modules + if stringInList 'msgpack' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'msgpack' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="msgpack $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use socket if available: move it before other modules + if stringInList 'socket' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'socket' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="socket $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use apcu if available: move it before other modules + if stringInList 'apcu' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'apcu' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="apcu $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # In any case, first of all, we need to install composer + if stringInList '@composer' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList '@composer' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="@composer $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi +} + +# Expand the IPE_ASPELL_LANGUAGES environment variable into apk/apt package names +expandASpellDictionaries() { + expandASpellDictionaries_languages="${IPE_ASPELL_LANGUAGES:-en}" + expandASpellDictionaries_result='' + resetIFS + for expandASpellDictionaries_language in $expandASpellDictionaries_languages; do + expandASpellDictionaries_result="$expandASpellDictionaries_result aspell-$expandASpellDictionaries_language" + done + printf '%s' "${expandASpellDictionaries_result# }" +} + +# Get the required APT/APK packages for a specific PHP version and for the list of module handles +# +# Arguments: +# $@: the PHP module handles +# +# Set: +# PACKAGES_PERSISTENT_NEW the list of packages required at runtume that must be installed +# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed +# PACKAGES_VOLATILE the list of packages required at compile time that must be installed +# PACKAGES_PREVIOUS the list of packages (with their version) that are installed right now (calculated only on Debian and only if PACKAGES_PERSISTENT_NEW or PACKAGES_VOLATILE are not empty) +buildRequiredPackageLists() { + buildRequiredPackageLists_persistent='' + buildRequiredPackageLists_volatile='' + case "$DISTRO" in + alpine) + apk update + ;; + debian) + invokeAptGetUpdate + ;; + esac + case "$DISTRO_VERSION" in + alpine@*) + if test $# -gt 1 || test "${1:-}" != '@composer'; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS" + fi + if test -z "$(apk info 2>/dev/null | grep -E ^libssl)"; then + buildRequiredPackageLists_libssl='libssl1.0' + elif test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libtls')" && test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libssl')" && test -z "$(apk info 2>/dev/null | grep -E '^libretls-')"; then + buildRequiredPackageLists_libssl=$(apk search -q libressl*-libtls) + else + buildRequiredPackageLists_libssl='' + fi + if test $DISTRO_MAJMIN_VERSION -le 313; then + buildRequiredPackageLists_libssldev='libressl-dev' + else + buildRequiredPackageLists_libssldev='libretls-dev' + fi + buildRequiredPackageLists_icuPersistent='' + if test $DISTRO_MAJMIN_VERSION -ge 316; then + case "${IPE_ICU_EN_ONLY:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_icuPersistent='icu-data-full' + ;; + esac + fi + ;; + debian@9) + buildRequiredPackageLists_libssldev='libssl1.0-dev' + ;; + debian@*) + buildRequiredPackageLists_libssldev='^libssl([0-9]+(\.[0-9]+)*)?-dev$' + ;; + esac + if test $USE_PICKLE -gt 1; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git" + fi + while :; do + if test $# -lt 1; then + break + fi + case "$1@$DISTRO" in + @composer@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unzip" + ;; + amqp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent rabbitmq-c" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile rabbitmq-c-dev" + ;; + amqp@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librabbitmq[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librabbitmq-dev libssh-dev" + ;; + bz2@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbz2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile bzip2-dev" + ;; + bz2@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libbz2-dev" + ;; + cassandra@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent cassandra-cpp-driver gmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cassandra-cpp-driver-dev gmp-dev" + ;; + cmark@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + ;; + cmark@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + ;; + ddtrace@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev" + ;; + ddtrace@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent curl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-openssl-dev" + ;; + dba@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent db" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile db-dev" + ;; + dba@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libdb5\.3-dev$" + if test $PHP_MAJMIN_VERSION -le 505; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile patch" + fi + ;; + decimal@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev" + ;; + enchant@alpine) + if test $DISTRO_MAJMIN_VERSION -ge 312; then + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" + else + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + fi + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant-dev" + fi + ;; + enchant@debian) + if test $DISTRO_VERSION_NUMBER -ge 11; then + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" + else + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-en libhunspell-1.7-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libglib2.0-dev libaspell-dev libhunspell-dev" + fi + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-dev" + fi + ;; + event@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev" + ;; + event@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libevent[0-9\.\-]*$ ^libevent-openssl[0-9\.\-]*$ ^libevent-extra[0-9\.\-]*$ ^libevent-pthreads[0-9\.\-]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev" + ;; + ffi@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libffi" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev" + ;; + ffi@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev" + ;; + gd@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetype libjpeg-turbo libpng libxpm" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetype-dev libjpeg-turbo-dev libpng-dev libxpm-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvpx" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + if test $DISTRO_MAJMIN_VERSION -ge 315; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libavif aom-libs libdav1d" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev aom-dev dav1d-dev" + elif isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + else + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson" + ;; + esac + fi + fi + fi + ;; + gd@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libvpx[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libwebp[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + if ! isLibaomInstalled || ! isLibdav1dInstalled || ! isLibyuvInstalled || ! isLibavifInstalled; then + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson" + ;; + esac + fi + fi + fi + ;; + gearman@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ libuuid" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile boost-dev gperf libmemcached-dev libevent-dev util-linux-dev" + ;; + gearman@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgearman[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgearman-dev" + ;; + geoip@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geoip" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geoip-dev" + ;; + geoip@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeoip1[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeoip-dev" + ;; + geos@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geos-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geos" + ;; + geos@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeos-c1(v[0-9]*)?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeos-dev" + ;; + gettext@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libintl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gettext-dev" + ;; + gmagick@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent graphicsmagick libgomp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile graphicsmagick-dev libtool" + ;; + gmagick@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgraphicsmagick(-q16-)?[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgraphicsmagick1-dev" + ;; + gmp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gmp-dev" + ;; + gmp@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgmp-dev" + ;; + gnupg@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gpgme" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gpgme-dev" + ;; + gnupg@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgpgme[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libgpgme[0-9]*-dev$" + ;; + grpc@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev linux-headers" + ;; + grpc@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + http@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev curl-dev libevent-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libidn" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libidn-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libidn" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev libidn-dev" + fi + ;; + http@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls ^libevent[0-9\.\-]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libgnutls28-dev libcurl4-gnutls-dev libevent-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libidn1[0-9+]-dev$" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$ ^libidn2-[0-9+]$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$" + fi + ;; + imagick@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent imagemagick libgomp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile imagemagick-dev" + ;; + imagick@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmagickwand-6.q16-[0-9]+$ ^libmagickcore-6.q16-[0-9]+-extra$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmagickwand-dev" + ;; + imap@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-client $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile krb5-dev imap-dev $buildRequiredPackageLists_libssldev" + ;; + imap@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-client2007e" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libkrb5-dev" + case "$DISTRO_VERSION" in + debian@9) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev comerr-dev krb5-multidev libc-client2007e libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-8 libpam0g-dev libssl-doc mlock" + ;; + *) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-client-dev" + ;; + esac + ;; + interbase@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + ;; + interbase@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util" + ;; + intl@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev" + ;; + intl@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev" + ;; + ion@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake git" + ;; + ion@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake git" + ;; + ldap@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libldap" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile openldap-dev" + ;; + ldap@debian) + if test $DISTRO_VERSION_NUMBER -ge 9; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libldap-common" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libldap2-dev" + ;; + luasandbox@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lua5.1-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lua5.1-dev" + ;; + luasandbox@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblua5.1-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblua5.1-0-dev" + ;; + lz4@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lz4-dev" + ;; + lz4@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblz4-1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblz4-dev" + ;; + maxminddb@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmaxminddb" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmaxminddb-dev" + ;; + maxminddb@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmaxminddb[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmaxminddb-dev" + ;; + memprof@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent judy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile judy-dev bsd-compat-headers" + ;; + memprof@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libjudydebian1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libjudy-dev" + ;; + mcrypt@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmcrypt" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmcrypt-dev" + ;; + mcrypt@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmcrypt4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmcrypt-dev" + ;; + memcache@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + memcache@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + memcached@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmemcached-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmemcached-dev zlib-dev" + ;; + memcached@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmemcachedutil2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmemcached-dev zlib1g-dev" + ;; + mongo@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsasl $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev cyrus-sasl-dev" + ;; + mongo@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libsasl2-dev" + ;; + mongodb@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libsasl $buildRequiredPackageLists_libssl snappy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev cyrus-sasl-dev snappy-dev $buildRequiredPackageLists_libssldev zlib-dev" + ;; + mongodb@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsnappy[0-9]+(v[0-9]+)?$ ^libicu[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev libsasl2-dev libsnappy-dev $buildRequiredPackageLists_libssldev zlib1g-dev" + ;; + mosquitto@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent mosquitto-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile mosquitto-dev" + ;; + mosquitto@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmosquitto1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmosquitto-dev" + ;; + mssql@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + mssql@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsybdb5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + oauth@alpine) + if test $PHP_MAJMIN_VERSION -ge 700; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev" + fi + ;; + oauth@debian) + if test $PHP_MAJMIN_VERSION -ge 700; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev" + fi + ;; + oci8@alpine | pdo_oci@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libaio libc6-compat libnsl" + if test $DISTRO_MAJMIN_VERSION -le 307; then + # The unzip tool of Alpine 3.7 can't extract symlinks from ZIP archives: let's use bsdtar instead + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libarchive-tools" + fi + ;; + oci8@debian | pdo_oci@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libaio[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unzip" + ;; + odbc@alpine | pdo_odbc@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + odbc@debian | pdo_odbc@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libodbc1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + openswoole@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + ;; + openswoole@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + ;; + parle@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + pdo_dblib@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + pdo_dblib@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsybdb5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + pdo_firebird@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + ;; + pdo_firebird@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util" + ;; + pgsql@alpine | pdo_pgsql@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile postgresql-dev" + ;; + pgsql@debian | pdo_pgsql@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpq-dev" + ;; + php_trie@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + pspell@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-libs $(expandASpellDictionaries)" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile aspell-dev" + ;; + pspell@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libaspell15 $(expandASpellDictionaries)" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpspell-dev" + ;; + rdkafka@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librdkafka" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev" + ;; + rdkafka@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librdkafka\+*[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev" + ;; + recode@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent recode" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile recode-dev" + ;; + recode@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librecode0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librecode-dev" + ;; + redis@alpine) + if test $PHP_MAJMIN_VERSION -ge 700; then + case "$DISTRO_VERSION" in + alpine@3.7) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd" + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + ;; + esac + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zstd-dev" + fi + ;; + redis@debian) + if test $PHP_MAJMIN_VERSION -ge 700; then + case "$DISTRO_VERSION" in + debian@8) + ## There's no APT package for libzstd + ;; + debian@9) + ## libzstd is too old (available: 1.1.2, required: 1.3.0+) + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + ;; + esac + fi + ;; + relay@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs zstd-libs" + if test $DISTRO_MAJMIN_VERSION -ge 317; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.1" + fi + ;; + simdjson@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + smbclient@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsmbclient" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile samba-dev" + ;; + smbclient@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsmbclient" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsmbclient-dev" + ;; + snappy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent snappy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile snappy-dev" + ;; + snappy@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsnappy1(v[0-9]+)?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsnappy-dev" + ;; + snmp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent net-snmp-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile net-snmp-dev" + ;; + snmp@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent snmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsnmp-dev" + ;; + snuffleupagus@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent pcre" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev" + ;; + snuffleupagus@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev" + ;; + soap@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + soap@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + sockets@alpine) + if test $PHP_MAJMIN_VERSION -ge 802; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + fi + ;; + sodium@alpine | libsodium@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsodium" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev" + ;; + sodium@debian | libsodium@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsodium[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev" + ;; + solr@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev libxml2-dev" + ;; + solr@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-gnutls-dev libxml2-dev" + ;; + spx@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + spx@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + sqlsrv@alpine | pdo_sqlsrv@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + sqlsrv@debian | pdo_sqlsrv@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + if ! isMicrosoftSqlServerODBCInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gnupg apt-transport-https" + fi + ;; + ssh2@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssh2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-dev" + ;; + ssh2@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-1-dev" + ;; + stomp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev" + ;; + stomp@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev" + ;; + swoole@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + fi + ;; + swoole@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + fi + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + fi + ;; + sybase_ct@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + sybase_ct@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libct4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + tdlib@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git cmake gperf zlib-dev $buildRequiredPackageLists_libssldev linux-headers readline-dev" + ;; + tdlib@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git cmake gperf zlib1g-dev $buildRequiredPackageLists_libssldev" + ;; + tensor@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lapack libexecinfo openblas" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lapack-dev libexecinfo-dev openblas-dev" + if test $DISTRO_MAJMIN_VERSION -le 310; then + if ! stringInList --force-overwrite "$IPE_APK_FLAGS"; then + IPE_APK_FLAGS="$IPE_APK_FLAGS --force-overwrite" + fi + fi + ;; + tensor@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblapacke libopenblas-base" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblapack-dev libopenblas-dev liblapacke-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gfortran-10" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgfortran-10-dev" + elif test $DISTRO_VERSION_NUMBER -ge 10; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gfortran-8" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgfortran-8-dev" + fi + ;; + tidy@alpine) + if test $DISTRO_MAJMIN_VERSION -ge 315; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent tidyhtml" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent tidyhtml-libs" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile tidyhtml-dev" + ;; + tidy@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libtidy-?[0-9][0-9.\-]*(deb[0-9])?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libtidy-dev" + ;; + uuid@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libuuid" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile util-linux-dev" + ;; + uuid@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile uuid-dev" + ;; + vips@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent vips" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile vips-dev" + ;; + vips@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvips" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvips-dev" + ;; + wddx@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + wddx@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xdebug@alpine) + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + fi + ;; + xlswriter@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + xlswriter@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + xmldiff@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmldiff@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmlrpc@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmlrpc@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xsl@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" + ;; + xsl@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libxslt1\.1$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev" + ;; + yaml@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent yaml" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile yaml-dev" + ;; + yaml@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libyaml-0-2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libyaml-dev" + ;; + yar@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev" + ;; + yar@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-gnutls-dev" + ;; + zip@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libzip-dev $buildRequiredPackageLists_libssldev zlib-dev" + ;; + zip@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzip[0-9]$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev $buildRequiredPackageLists_libssldev libzip-dev libbz2-dev zlib1g-dev" + case "$DISTRO_VERSION" in + debian@8) + # Debian Jessie doesn't seem to provide libmbedtls + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmbedtls[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmbedtls-dev" + ;; + esac + ;; + zmq@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zeromq-dev" + ;; + zmq@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzmq3-dev" + ;; + zookeeper@alpine) + if ! test -f /usr/local/include/zookeeper/zookeeper.h; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile maven automake libtool openjdk8" + fi + ;; + zookeeper@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzookeeper-mt2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzookeeper-mt-dev" + ;; + esac + shift + done + PACKAGES_PERSISTENT_NEW='' + PACKAGES_PERSISTENT_PRE='' + PACKAGES_VOLATILE='' + PACKAGES_PREVIOUS='' + if test -z "$buildRequiredPackageLists_persistent$buildRequiredPackageLists_volatile"; then + return + fi + if test -n "$buildRequiredPackageLists_persistent"; then + PACKAGES_PERSISTENT_NEW="$(expandPackagesToBeInstalled $buildRequiredPackageLists_persistent)" + if test -s "$IPE_ERRFLAG_FILE"; then + exit 1 + fi + resetIFS + for buildRequiredPackageLists_package in $buildRequiredPackageLists_persistent; do + buildRequiredPackageLists_package="$(expandInstalledSystemPackageName "$buildRequiredPackageLists_package")" + if test -n "$buildRequiredPackageLists_package"; then + PACKAGES_PERSISTENT_PRE="$PACKAGES_PERSISTENT_PRE $buildRequiredPackageLists_package" + fi + done + PACKAGES_PERSISTENT_PRE="${PACKAGES_PERSISTENT_PRE# }" + fi + if test -n "$buildRequiredPackageLists_volatile"; then + buildRequiredPackageLists_packages="$(expandPackagesToBeInstalled $buildRequiredPackageLists_volatile)" + if test -s "$IPE_ERRFLAG_FILE"; then + exit 1 + fi + resetIFS + for buildRequiredPackageLists_package in $buildRequiredPackageLists_packages; do + if ! stringInList "$buildRequiredPackageLists_package" "$PACKAGES_PERSISTENT_NEW"; then + if test "$buildRequiredPackageLists_package" != icu-data-en || ! stringInList icu-data-full "$PACKAGES_PERSISTENT_NEW"; then + PACKAGES_VOLATILE="$PACKAGES_VOLATILE $buildRequiredPackageLists_package" + fi + fi + done + PACKAGES_VOLATILE="${PACKAGES_VOLATILE# }" + fi + if test -n "$PACKAGES_PERSISTENT_NEW$PACKAGES_VOLATILE"; then + case "$DISTRO" in + debian) + PACKAGES_PREVIOUS="$(dpkg --get-selections | grep -E '\sinstall$' | awk '{ print $1 }')" + ;; + esac + fi +} + +# Get the full list of APT/APK packages that will be installed, given the required packages +# +# Arguments: +# $1: the list of required APT/APK packages +# +# Output: +# Space-separated list of every APT/APK packages that will be installed +expandPackagesToBeInstalled() { + expandPackagesToBeInstalled_result='' + case "$DISTRO" in + alpine) + expandPackagesToBeInstalled_log="$(apk add --simulate $@ 2>&1 || printf '\nERROR: apk failed\n')" + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^ERROR:')"; then + printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 + printf '%s ' "$@" >&2 + printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2 + echo 'y' >"$IPE_ERRFLAG_FILE" + exit 1 + fi + IFS=' +' + for expandPackagesToBeInstalled_line in $expandPackagesToBeInstalled_log; do + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_line" | grep -E '^\([0-9]*/[0-9]*) Installing ')"; then + expandPackagesToBeInstalled_result="$expandPackagesToBeInstalled_result $(printf '%s' "$expandPackagesToBeInstalled_line" | cut -d ' ' -f 3)" + fi + done + resetIFS + ;; + debian) + expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then + printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 + printf '%s ' "$@" >&2 + printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2 + echo 'y' >"$IPE_ERRFLAG_FILE" + exit 1 + fi + expandPackagesToBeInstalled_inNewPackages=0 + IFS=' +' + for expandPackagesToBeInstalled_line in $expandPackagesToBeInstalled_log; do + if test $expandPackagesToBeInstalled_inNewPackages -eq 0; then + if test "$expandPackagesToBeInstalled_line" = 'The following NEW packages will be installed:'; then + expandPackagesToBeInstalled_inNewPackages=1 + fi + elif test "$expandPackagesToBeInstalled_line" = "${expandPackagesToBeInstalled_line# }"; then + break + else + resetIFS + for expandPackagesToBeInstalled_newPackage in $expandPackagesToBeInstalled_line; do + expandPackagesToBeInstalled_result="$expandPackagesToBeInstalled_result $expandPackagesToBeInstalled_newPackage" + done + IFS=' +' + fi + done + resetIFS + ;; + esac + printf '%s' "${expandPackagesToBeInstalled_result# }" +} + +# Check if a system package is installed; if so we prints its name. +# +# Arguments: +# $1: the name of the package to be checked (regular expressions accepted: they must start with a ^) +expandInstalledSystemPackageName() { + if test "$1" = "${1#^}"; then + expandInstalledSystemPackageName_grepflags='-Fx' + else + expandInstalledSystemPackageName_grepflags='-E' + fi + case "$DISTRO" in + alpine) + apk info | grep $expandInstalledSystemPackageName_grepflags -- "$1" || test $? -eq 1 + ;; + debian) + dpkg --get-selections | grep -E '\sinstall$' | awk '{ print $1 }' | cut -d: -f1 | grep $expandInstalledSystemPackageName_grepflags -- "$1" || test $? -eq 1 + ;; + esac +} + +# Retrieve the number of available cores (alternative to nproc if not available) +# +# Output: +# The number of processor cores available +getProcessorCount() { + if command -v nproc >/dev/null 2>&1; then + nproc + else + getProcessorCount_tmp=$(cat /proc/cpuinfo | grep -E '^processor\s*:\s*\d+$' | wc -l) + if test $getProcessorCount_tmp -ge 1; then + echo $getProcessorCount_tmp + else + echo 1 + fi + fi +} + +# Set these variables: +# - TARGET_TRIPLET the build target tripled (eg 'x86_64-linux-gnu', 'x86_64-alpine-linux-musl') +setTargetTriplet() { + TARGET_TRIPLET="$(gcc -print-multiarch 2>/dev/null || true)" + if test -z "$TARGET_TRIPLET"; then + TARGET_TRIPLET="$(gcc -dumpmachine)" + fi +} + +# Retrieve the number of processors to be used when compiling an extension +# +# Arguments: +# $1: the handle of the PHP extension to be compiled +# Output: +# The number of processors to be used +getCompilationProcessorCount() { + case "$1" in + '') + # The above extensions don't support parallel compilation + echo 1 + ;; + *) + # All the other extensions support parallel compilation + getProcessorCount + ;; + esac +} + +# Get the full path of a PHP extension given its name. +# +# Arguments: +# $1: the name of the PHP extension +# +# Output: +# The absolute path of the PHP extension file (or nothing if the file can't be found) +getModuleFullPath() { + case "$1" in + apcu_bc) + getModuleFullPath_path="$PHP_EXTDIR/apc.so" + ;; + *) + getModuleFullPath_path="$PHP_EXTDIR/$1.so" + ;; + esac + if ! test -f "$getModuleFullPath_path"; then + printf 'Unable to find the file of the PHP extension "%s"\n' "$1" >&2 + exit 1 + fi + printf '%s' "$getModuleFullPath_path" +} + +# Post-process a PHP module just compiled and installed in the PHP extension directory +# +# Arguments: +# $1: the name of the PHP extension +# +# Return: +# 0 (true): if suceeded +# non-zero (false): in case of errors +postProcessModule() { + postProcessModule_file="$(getModuleFullPath "$1")" + if test $PHP_DEBUGBUILD -ne 1; then + printf 'Removing symbols from %s... ' "$postProcessModule_file" + postProcessModule_preSize="$(stat -c %s "$postProcessModule_file")" + strip --strip-all "$postProcessModule_file" + postProcessModule_postSize="$(stat -c %s "$postProcessModule_file")" + printf 'done (%s bytes saved).\n' "$((postProcessModule_preSize - postProcessModule_postSize))" + fi + return $? +} + +# Get the type of the php.ini entry to be used for a PHP extension +# +# Arguments: +# $1: the name of the PHP extension +# +# Output: +# zend_extension or extension +getModuleIniEntryType() { + case "$1" in + ioncube_loader | sourceguardian) + # On PHP 5.5, docker-php-ext-enable fails to detect that ionCube Loader and sourceguardian are Zend extensions + if test $PHP_MAJMIN_VERSION -le 505; then + printf 'zend_extension' + return 0 + fi + ;; + esac + getModuleIniEntryType_file="$(getModuleFullPath "$1")" + if readelf --wide --syms "$getModuleIniEntryType_file" | grep -Eq ' zend_extension_entry$'; then + printf 'zend_extension' + else + printf 'extension' + fi +} + +# Create the contents of a PHP ini file that enables an extension +# +# Arguments: +# $1: the name of the PHP extension +# $2: additional php.ini configuration (optional) +# +# Output: +# The contents of the ini file +buildPhpExtensionIniContent() { + buildPhpExtensionIniContent_type="$(getModuleIniEntryType "$1")" + buildPhpExtensionIniContent_soFile="$(getModuleFullPath "$1")" + buildPhpExtensionIniContent_result="$(printf '%s=%s' "$buildPhpExtensionIniContent_type" "${buildPhpExtensionIniContent_soFile##$PHP_EXTDIR/}")" + if test -n "${2:-}"; then + buildPhpExtensionIniContent_result="$(printf '%s\n%s' "$buildPhpExtensionIniContent_result" "$2")" + fi + printf '%s' "$buildPhpExtensionIniContent_result" +} + +# Check that a PHP module actually works (better to run this check before enabling the extension) +# +# Arguments: +# $1: the name of the PHP extension +# $2: base name (without path and extension) of additional php.ini configuration (optional) +# $3: additional php.ini configuration (optional) +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +checkModuleWorking() { + if test -n "${2:-}"; then + checkModuleWorking_iniFile="$PHP_INI_DIR/conf.d/$2--temp.ini" + else + checkModuleWorking_iniFile="$PHP_INI_DIR/conf.d/docker-php-ext-$1--temp.ini" + fi + checkModuleWorking_iniContent="$(buildPhpExtensionIniContent "$1" "${3:-}")" + printf 'Check if the %s module can be loaded... ' "$1" + checkModuleWorking_errBefore="$(php -r 'return;' 2>&1 || true)" + printf '%s' "$checkModuleWorking_iniContent" >"$checkModuleWorking_iniFile" + checkModuleWorking_errAfter="$(php -r 'return;' 2>&1 || true)" + rm "$checkModuleWorking_iniFile" + if test "$checkModuleWorking_errAfter" != "$checkModuleWorking_errBefore"; then + printf 'Error loading the "%s" extension:\n%s\n' "$1" "$checkModuleWorking_errAfter" >&2 + return 1 + fi + printf 'ok.\n' + return 0 +} + +# Enable a PHP extension +# +# Arguments: +# $1: the name of the PHP extension to be enabled +# $2: base name (without path and extension) of additional php.ini configuration (optional) +# $3: additional php.ini configuration (optional) +enablePhpExtension() { + if test -n "${2:-}"; then + enablePhpExtension_iniFile="$PHP_INI_DIR/conf.d/$2.ini" + else + enablePhpExtension_iniFile="$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" + fi + enablePhpExtension_iniContent="$(buildPhpExtensionIniContent "$1" "${3:-}")" + case "${IPE_DONT_ENABLE:-}" in + 1 | y* | Y*) + enablePhpExtension_enableCommand="/usr/local/bin/docker-php-ext-enable-$1" + printf '%s' "$enablePhpExtension_iniContent" >"$enablePhpExtension_iniFile-disabled" + printf '\n' >>"$enablePhpExtension_iniFile-disabled" + cat <"$enablePhpExtension_enableCommand" +#!/bin/sh + +if test -f '$enablePhpExtension_iniFile-disabled'; then + echo 'Enabling extension $1' + mv '$enablePhpExtension_iniFile-disabled' '$enablePhpExtension_iniFile' +else + echo 'The extension $1 has already been enabled' +fi +EOT + chmod +x "$enablePhpExtension_enableCommand" + printf '## Extension %s not enabled.\nYou can enable it by running the following command:\n%s\n\n' "$1" "$(basename "$enablePhpExtension_enableCommand")" + ;; + *) + printf '%s' "$enablePhpExtension_iniContent" >"$enablePhpExtension_iniFile" + printf '\n' >>"$enablePhpExtension_iniFile" + ;; + esac +} + +# Mark the pre-installed APT/APK packages as used +# that way they won't be uninstalled by accident +markPreinstalledPackagesAsUsed() { + printf '### MARKING PRE-INSTALLED PACKAGES AS IN-USE ###\n' + case "$DISTRO" in + alpine) + printf '# Packages: %s\n' "$PACKAGES_PERSISTENT_PRE" + apk add $PACKAGES_PERSISTENT_PRE + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + ;; + esac +} + +# Install the required APT/APK packages +# +# Arguments: +# $@: the list of APT/APK packages to be installed +installRequiredPackages() { + printf '### INSTALLING REQUIRED PACKAGES ###\n' + printf '# Packages to be kept after installation: %s\n' "$PACKAGES_PERSISTENT_NEW" + printf '# Packages to be used only for installation: %s\n' "$PACKAGES_VOLATILE" + case "$DISTRO" in + alpine) + apk add $IPE_APK_FLAGS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + # https://gitlab.alpinelinux.org/alpine/aports/-/issues/12763#note_172090 + # https://github.com/mlocati/docker-php-extension-installer/issues/385 + # https://github.com/mlocati/docker-php-extension-installer/issues/537#issuecomment-1078748882 + for installRequiredPackages_item in wget; do + if test -n "$(expandInstalledSystemPackageName "$installRequiredPackages_item")"; then + apk add --upgrade "$installRequiredPackages_item" + fi + done + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + ;; + esac +} + +# Get the version of an installed APT/APK package +# +# Arguments: +# $1: the name of the installed package +# +# Output: +# The numeric part of the package version, with from 1 to 3 numbers +# +# Example: +# 1 +# 1.2 +# 1.2.3 +getInstalledPackageVersion() { + case "$DISTRO" in + alpine) + apk info "$1" | head -n1 | cut -c $((${#1} + 2))- | grep -o -E '^[0-9]+(\.[0-9]+){0,2}' + ;; + debian) + dpkg-query --showformat='${Version}' --show "$1" 2>/dev/null | grep -o -E '^[0-9]+(\.[0-9]+){0,2}' + ;; + esac +} + +# Compare two versions +# +# Arguments: +# $1: the first version +# $2: the second version +# +# Output +# -1 if $1 is less than $2 +# 0 if $1 is the same as $2 +# 1 if $1 is greater than $2 +compareVersions() { + compareVersions_v1="$1.0.0" + compareVersions_v2="$2.0.0" + compareVersions_vMin="$(printf '%s\n%s' "$compareVersions_v1" "$compareVersions_v2" | sort -t '.' -n -k1,1 -k2,2 -k3,3 | head -n 1)" + if test "$compareVersions_vMin" != "$compareVersions_v1"; then + echo '1' + elif test "$compareVersions_vMin" = "$compareVersions_v2"; then + echo '0' + else + echo '-1' + fi +} + +# Install Oracle Instant Client & SDK +# +# Set: +# ORACLE_INSTANTCLIENT_LIBPATH +installOracleInstantClient() { + case "${IPE_INSTANTCLIENT_BASIC:-}" in + 1 | y* | Y*) + installOracleInstantClient_handle=basic + ;; + *) + installOracleInstantClient_handle=basiclite + ;; + esac + case $PHP_BITS in + 32) + installOracleInstantClient_client=client + installOracleInstantClient_version='19.9' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-$installOracleInstantClient_handle-linux-$installOracleInstantClient_version.0.0.0dbru.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-sdk-linux-$installOracleInstantClient_version.0.0.0dbru.zip + ;; + *) + case $(uname -m) in + aarch64*) + installOracleInstantClient_client=client64 + installOracleInstantClient_version='19.10' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-$installOracleInstantClient_handle-linux.arm64-$installOracleInstantClient_version.0.0.0dbru.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-sdk-linux.arm64-$installOracleInstantClient_version.0.0.0dbru.zip + ;; + *) + installOracleInstantClient_client=client64 + installOracleInstantClient_version='21.1' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-$installOracleInstantClient_handle-linux.x64-$installOracleInstantClient_version.0.0.0.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-sdk-linux.x64-$installOracleInstantClient_version.0.0.0.zip + ;; + esac + ;; + esac + ORACLE_INSTANTCLIENT_LIBPATH=/usr/lib/oracle/$installOracleInstantClient_version/$installOracleInstantClient_client/lib + if ! test -e "$ORACLE_INSTANTCLIENT_LIBPATH"; then + printf 'Downloading Oracle Instant Client v%s (%s)... ' "$installOracleInstantClient_version" "$installOracleInstantClient_handle" + installOracleInstantClient_src="$(getPackageSource $installOracleInstantClient_ic)" + mkdir -p "/usr/lib/oracle/$installOracleInstantClient_version/$installOracleInstantClient_client" + mv "$installOracleInstantClient_src" "$ORACLE_INSTANTCLIENT_LIBPATH" + echo 'done.' + fi + if ! test -e "$ORACLE_INSTANTCLIENT_LIBPATH/sdk"; then + printf 'Downloading Oracle Instant SDK v%s... ' "$installOracleInstantClient_version" + installOracleInstantClient_src="$(getPackageSource $installOracleInstantClient_sdk)" + ln -sf "$installOracleInstantClient_src/sdk" "$ORACLE_INSTANTCLIENT_LIBPATH/sdk" + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS '$ORACLE_INSTANTCLIENT_LIBPATH/sdk'" + echo 'done.' + fi + case "$DISTRO" in + alpine) + if ! test -e /usr/lib/libresolv.so.2 && test -e /lib/libc.so.6; then + ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 + fi + installOracleInstantClient_ldconf=/etc/ld-musl-${TARGET_TRIPLET%-alpine-linux-musl}.path + if test -e "$installOracleInstantClient_ldconf"; then + if ! cat "$installOracleInstantClient_ldconf" | grep -q "$ORACLE_INSTANTCLIENT_LIBPATH"; then + cat "$ORACLE_INSTANTCLIENT_LIBPATH" | awk -v suffix=":$ORACLE_INSTANTCLIENT_LIBPATH" '{print NR==1 ? $0suffix : $0}' >"$ORACLE_INSTANTCLIENT_LIBPATH" + fi + else + case $PHP_BITS in + 32) + echo "/lib:/usr/local/lib:/usr/lib:$ORACLE_INSTANTCLIENT_LIBPATH" >"$installOracleInstantClient_ldconf" + ;; + *) + echo "/lib64:/lib:/usr/local/lib:/usr/lib:$ORACLE_INSTANTCLIENT_LIBPATH" >"$installOracleInstantClient_ldconf" + ;; + esac + fi + ;; + debian) + if ! test -e /etc/ld.so.conf.d/oracle-instantclient.conf; then + echo "$ORACLE_INSTANTCLIENT_LIBPATH" >/etc/ld.so.conf.d/oracle-instantclient.conf + ldconfig + fi + ;; + esac +} + +# Check if the Microsoft SQL Server ODBC Driver is installed +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +isMicrosoftSqlServerODBCInstalled() { + test -d /opt/microsoft/msodbcsql*/ +} + +# Install the Microsoft SQL Server ODBC Driver +installMicrosoftSqlServerODBC() { + printf 'Installing the Microsoft SQL Server ODBC Driver\n' + case "$DISTRO" in + alpine) + # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#alpine17 + rm -rf /tmp/src/msodbcsql.apk + if test $PHP_MAJMIN_VERSION -le 703; then + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.9.1.1-1_amd64.apk + else + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/msodbcsql18_18.0.1.1-1_amd64.apk + fi + printf '\n' | apk add --allow-untrusted /tmp/src/msodbcsql.apk + rm -rf /tmp/src/msodbcsql.apk + ;; + debian) + # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#debian17 + printf -- '- installing the Microsoft APT key\n' + if test $DISTRO_VERSION_NUMBER -ge 11; then + # apt-key is deprecated + curl -sSLf -o /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc + else + curl -sSLf https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + fi + if ! test -f /etc/apt/sources.list.d/mssql-release.list; then + printf -- '- adding the Microsoft APT source list\n' + curl -sSLf https://packages.microsoft.com/config/debian/$DISTRO_VERSION_NUMBER/prod.list >/etc/apt/sources.list.d/mssql-release.list + invokeAptGetUpdate + fi + printf -- '- installing the APT package\n' + if test $PHP_MAJMIN_VERSION -le 703; then + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + elif test $DISTRO_VERSION_NUMBER -ge 9 && $DISTRO_VERSION_NUMBER -le 11; then + # On Debian 9 and 11 we have both msodbcsql17 and msodbcsql18: let's install just one + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + else + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + fi + ;; + esac +} + +# Check if libaom is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibaomInstalled() { + if ! test -f /usr/local/lib/libaom.so && ! test -f /usr/lib/libaom.so; then + return 1 + fi + if ! test -f /usr/local/include/aom/aom_codec.h && ! test -f /usr/include/aom/aom_codec.h; then + return 1 + fi + return 0 +} + +# Install libaom +installLibaom() { + printf 'Installing libaom\n' + installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v3.3.0.tar.gz)" + mkdir -- "$installLibaom_dir/my.build" + cd -- "$installLibaom_dir/my.build" + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DCMAKE_INSTALL_LIBDIR:PATH=lib .. + ninja -j $(getProcessorCount) install + cd - >/dev/null + ldconfig || true +} + +# Check if libdav1d is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibdav1dInstalled() { + if ! test -f /usr/local/lib/libdav1d.so && ! test -f /usr/lib/libdav1d.so && ! test -f /usr/lib/x86_64*/libdav1d.so; then + return 1 + fi + if ! test -f /usr/local/include/dav1d/dav1d.h && ! test -f /usr/include/dav1d/dav1d.h; then + return 1 + fi + return 0 +} + +# Install libdav1d +installLibdav1d() { + printf 'Installing libdav1d\n' + installLibdav1d_dir="$(getPackageSource https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz)" + mkdir -- "$installLibdav1d_dir/build" + cd -- "$installLibdav1d_dir/build" + meson --buildtype release -Dprefix=/usr .. + ninja -j $(getProcessorCount) install + cd - >/dev/null + if test -f /usr/lib/$TARGET_TRIPLET/libdav1d.so && ! test -f /usr/lib/libdav1d.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libdav1d.so /usr/lib/ + fi + ldconfig || true +} + +# Check if libyuv is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibyuvInstalled() { + if ! test -f /usr/local/lib/libyuv.so && ! test -f /usr/lib/libyuv.so && ! test -f /usr/lib/x86_64*/libyuv.so; then + return 1 + fi + if ! test -f /usr/local/include/libyuv.h && ! test -f /usr/include/libyuv.h; then + return 1 + fi + return 0 +} + +# Install libyuv +installLibyuv() { + printf 'Installing libyuv\n' + installLibyuv_dir="$(getPackageSource https://chromium.googlesource.com/libyuv/libyuv/+archive/25d0a5110be796eef47004412baf43333d9ecf26.tar.gz)" + mkdir -- "$installLibyuv_dir/build" + cd -- "$installLibyuv_dir/build" + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -B. .. + make -j$(getProcessorCount) install + cd - >/dev/null +} + +# Check if libavif is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibavifInstalled() { + if ! test -f /usr/local/lib/libavif.so && ! test -f /usr/lib/libavif.so && ! test -f /usr/lib/x86_64*/libavif.so; then + return 1 + fi + if ! test -f /usr/local/include/avif/avif.h && ! test -f /usr/include/avif/avif.h; then + return 1 + fi + return 0 +} + +# Install libavif +installLibavif() { + printf 'Installing libavif\n' + installLibavif_dir="$(getPackageSource https://codeload.github.com/AOMediaCodec/libavif/tar.gz/refs/tags/v0.9.3)" + mkdir -- "$installLibavif_dir/build" + cd -- "$installLibavif_dir/build" + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DAVIF_CODEC_AOM=ON -DCMAKE_INSTALL_LIBDIR:PATH=lib + make -j$(getProcessorCount) install + cd - >/dev/null +} + +# Install Composer +installComposer() { + installComposer_version="$(getWantedPHPModuleVersion @composer)" + installComposer_version="${installComposer_version#^}" + if test -z "$installComposer_version"; then + installComposer_fullname=composer + installComposer_flags='' + else + installComposer_fullname="$(printf 'composer v%s' "$installComposer_version")" + if printf '%s' "$installComposer_version" | grep -Eq '^[0-9]+$'; then + installComposer_flags="--$installComposer_version" + else + installComposer_flags="--version=$installComposer_version" + fi + fi + printf '### INSTALLING %s ###\n' "$installComposer_fullname" + actuallyInstallComposer /usr/local/bin composer "$installComposer_flags" +} + +# Actually install composer +# +# Arguments: +# $1: the directory where composer should be installed (required) +# $2: the composer filename (optional, default: composer) +# $3. additional flags for the composer installed (optional) +actuallyInstallComposer() { + actuallyInstallComposer_installer="$(mktemp -p /tmp/src)" + curl -sSLf -o "$actuallyInstallComposer_installer" https://getcomposer.org/installer + actuallyInstallComposer_expectedSignature="$(curl -sSLf https://composer.github.io/installer.sig)" + actuallyInstallComposer_actualSignature="$(php -n -r "echo hash_file('sha384', '$actuallyInstallComposer_installer');")" + if test "$actuallyInstallComposer_expectedSignature" != "$actuallyInstallComposer_actualSignature"; then + printf 'Verification of composer installer failed!\nExpected signature: %s\nActual signature: %s\n' "$actuallyInstallComposer_expectedSignature" "$actuallyInstallComposer_actualSignature" >&2 + exit 1 + fi + actuallyInstallComposer_flags="--install-dir=$1" + if test -n "${2:-}"; then + actuallyInstallComposer_flags="$actuallyInstallComposer_flags --filename=$2" + else + actuallyInstallComposer_flags="$actuallyInstallComposer_flags --filename=composer" + fi + if test -n "${3:-}"; then + actuallyInstallComposer_flags="$actuallyInstallComposer_flags $3" + fi + php "$actuallyInstallComposer_installer" $actuallyInstallComposer_flags + rm -- "$actuallyInstallComposer_installer" +} + +# Install ionCube Loader +installIonCubeLoader() { + # See https://www.ioncube.com/loaders.php + case $PHP_BITS in + 32) + case $(uname -m) in + aarch* | arm*) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + ;; + *) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + ;; + esac + ;; + *) + case $(uname -m) in + aarch64 | arm64 | armv8) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + ;; + *) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + ;; + esac + ;; + esac + printf 'Downloading ionCube Loader... ' + installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" + echo 'done.' + installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") + cp "$installIonCubeLoader_dir/$installIonCubeLoader_so" "$(getPHPExtensionsDir)/ioncube_loader.so" +} + +# Install SourceGuardian Loader +installSourceGuardian() { + # See https://www.sourceguardian.com/loaders.html + case $PHP_BITS in + 32) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-i386.tar.gz + ;; + *) + case $(uname -m) in + aarch64 | arm64 | armv8) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz + ;; + *) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz + ;; + esac + ;; + esac + printf 'Downloading SourceGuardian... ' + installSourceGuardian_dir="$(getPackageSource $installSourceGuardian_url)" + printf 'done (version: %s)\n' "$(cat "$installSourceGuardian_dir/version")" + for installSourceGuardian_phpv in $PHP_MAJDOTMINDOTPAT_VERSION $PHP_MAJDOTMIN_VERSION; do + installSourceGuardian_file="$installSourceGuardian_dir/ixed.$PHP_MAJDOTMIN_VERSION" + if test $PHP_THREADSAFE -eq 1; then + installSourceGuardian_file="${installSourceGuardian_file}ts" + fi + installSourceGuardian_file="${installSourceGuardian_file}.lin" + if test -f "$installSourceGuardian_file"; then + mv "$installSourceGuardian_file" "$(getPHPExtensionsDir)/sourceguardian.so" + return + fi + done + printf 'Unable to find a SourceGuardian compatible with PHP %s or PHP %s.\nAvailable SourceGuardian versions:\n' "$PHP_MAJDOTMINDOTPAT_VERSION" "$PHP_MAJDOTMIN_VERSION" >&2 + ls -1 "$installSourceGuardian_dir" | grep -E '^ixed\..*\.lin$' | sed -E 's/^[^0-9]+([0-9]+(\.[0-9]+)*).*$/\1/' | sort | uniq >&2 + exit 1 +} + +# Install a bundled PHP module given its handle +# +# Arguments: +# $1: the handle of the PHP module +# +# Set: +# UNNEEDED_PACKAGE_LINKS +# +# Output: +# Nothing +installBundledModule() { + printf '### INSTALLING BUNDLED MODULE %s ###\n' "$1" + if test -n "$(getWantedPHPModuleVersion "$1")"; then + printf '### WARNING the module "%s" is bundled with PHP, you can NOT specify a version for it\n' "$1" >&2 + fi + if test -n "$(getModuleSourceCodePath "$1")"; then + printf '### WARNING the module "%s" is bundled with PHP, you can NOT specify a source code path for it\n' "$1" >&2 + fi + case "$1" in + dba) + if test -e /usr/lib/$TARGET_TRIPLET/libdb-5.3.so && ! test -e /usr/lib/libdb-5.3.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libdb-5.3.so /usr/lib/ + fi + if test $PHP_MAJMIN_VERSION -le 505; then + docker-php-source extract + patch /usr/src/php/ext/dba/config.m4 </dev/null + fi + ;; + gd) + if test $PHP_MAJMIN_VERSION -le 506; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-vpx-dir + elif test $PHP_MAJMIN_VERSION -le 701; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-webp-dir + elif test $PHP_MAJMIN_VERSION -le 703; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --with-webp-dir + elif test $PHP_MAJMIN_VERSION -le 800; then + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype + else + installBundledModule_tmp=0 + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -ge 315; then + installBundledModule_tmp=1 + fi + ;; + esac + if test $installBundledModule_tmp -eq 0; then + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + if ! isLibaomInstalled; then + installLibaom + fi + if ! isLibdav1dInstalled; then + installLibdav1d + fi + if ! isLibyuvInstalled; then + installLibyuv + fi + if ! isLibavifInstalled; then + installLibavif + fi + ;; + esac + if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then + installBundledModule_tmp=1 + fi + fi + if test $installBundledModule_tmp -eq 1; then + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif + else + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype + fi + fi + ;; + gmp) + if test $PHP_MAJMIN_VERSION -le 506; then + if ! test -f /usr/include/gmp.h; then + ln -s /usr/include/$TARGET_TRIPLET/gmp.h /usr/include/gmp.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/gmp.h" + fi + fi + ;; + imap) + case "$DISTRO_VERSION" in + debian@9) + installBundledModule_tmp="$(pwd)" + cd /tmp + apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* + rm libc-client2007e-dev* + cd "$installBundledModule_tmp" + ;; + esac + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl + ;; + interbase | pdo_firebird) + case "$DISTRO" in + alpine) + if ! test -d /tmp/src/firebird; then + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi + CFLAGS='-I/tmp/src/firebird/src/jrd -I/tmp/src/firebird/src/include -I/tmp/src/firebird/src/include/gen' docker-php-ext-configure $1 + ;; + esac + ;; + ldap) + case "$DISTRO" in + debian) + docker-php-ext-configure ldap --with-libdir=lib/$TARGET_TRIPLET + ;; + esac + ;; + mssql | pdo_dblib) + if ! test -f /usr/lib/libsybdb.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libsybdb.so /usr/lib/libsybdb.so + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/lib/libsybdb.so" + fi + ;; + odbc) + docker-php-source extract + cd /usr/src/php/ext/odbc + phpize + sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure + ./configure --with-unixODBC=shared,/usr + cd - >/dev/null + ;; + oci8 | pdo_oci) + installOracleInstantClient + if test "$1" = oci8; then + docker-php-ext-configure "$1" "--with-oci8=instantclient,$ORACLE_INSTANTCLIENT_LIBPATH" + elif test "$1" = pdo_oci; then + docker-php-ext-configure "$1" "--with-pdo-oci=instantclient,$ORACLE_INSTANTCLIENT_LIBPATH" + fi + ;; + pdo_odbc) + docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr + ;; + snmp) + case "$DISTRO" in + alpine) + mkdir -p -m 0755 /var/lib/net-snmp/mib_indexes + ;; + esac + ;; + sockets) + case "$PHP_MAJDOTMINDOTPAT_VERSION" in + 8.0.15 | 8.1.2) + sed -i '70 i #ifndef _GNU_SOURCE' /usr/src/php/ext/sockets/config.m4 + sed -i '71 i #define _GNU_SOURCE' /usr/src/php/ext/sockets/config.m4 + sed -i '72 i #endif' /usr/src/php/ext/sockets/config.m4 + ;; + esac + ;; + sybase_ct) + docker-php-ext-configure sybase_ct --with-sybase-ct=/usr + ;; + tidy) + case "$DISTRO" in + alpine) + if ! test -f /usr/include/buffio.h; then + ln -s /usr/include/tidybuffio.h /usr/include/buffio.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/buffio.h" + fi + ;; + esac + ;; + zip) + if test $PHP_MAJMIN_VERSION -le 505; then + docker-php-ext-configure zip + elif test $PHP_MAJMIN_VERSION -le 703; then + docker-php-ext-configure zip --with-libzip + else + docker-php-ext-configure zip --with-zip + fi + ;; + esac + installBundledModule_errBefore="$(php -r 'return;' 2>&1 || true)" + docker-php-ext-install -j$(getProcessorCount) "$1" + case "$1" in + imap) + case "$DISTRO_VERSION" in + debian@9) + dpkg -r libc-client2007e-dev + ;; + esac + ;; + esac + php -r 'return;' >/dev/null 2>/dev/null || true + installBundledModule_errAfter="$(php -r 'return;' 2>&1 || true)" + if test "$installBundledModule_errAfter" != "$installBundledModule_errBefore"; then + printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_errAfter" >&2 + rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true + return 1 + fi +} + +# Fetch a tar.gz file, extract it and returns the path of the extracted folder. +# +# Arguments: +# $1: the URL of the file to be downloaded +# +# Output: +# The path of the extracted directory +getPackageSource() { + mkdir -p /tmp/src + getPackageSource_tempFile=$(mktemp -p /tmp/src) + curl -sSLf -o "$getPackageSource_tempFile" "$1" + getPackageSource_tempDir=$(mktemp -p /tmp/src -d) + cd "$getPackageSource_tempDir" + tar -xzf "$getPackageSource_tempFile" 2>/dev/null || tar -xf "$getPackageSource_tempFile" 2>/dev/null || ( + if command -v bsdtar >/dev/null; then + bsdtar -xf "$getPackageSource_tempFile" + else + unzip -q "$getPackageSource_tempFile" + fi + ) + cd - >/dev/null + unlink "$getPackageSource_tempFile" + getPackageSource_outDir='' + for getPackageSource_i in $(ls "$getPackageSource_tempDir"); do + if test -n "$getPackageSource_outDir" || test -f "$getPackageSource_tempDir/$getPackageSource_i"; then + getPackageSource_outDir='' + break + fi + getPackageSource_outDir="$getPackageSource_tempDir/$getPackageSource_i" + done + if test -n "$getPackageSource_outDir"; then + printf '%s' "$getPackageSource_outDir" + else + printf '%s' "$getPackageSource_tempDir" + fi +} + +# Install a PECL/remote PHP module given its handle +# +# Arguments: +# $1: the handle of the PHP module +installRemoteModule() { + installRemoteModule_module="$1" + printf '### INSTALLING REMOTE MODULE %s ###\n' "$installRemoteModule_module" + installRemoteModule_version="$(resolveWantedPHPModuleVersion "$installRemoteModule_module")" + installRemoteModule_path="$(getModuleSourceCodePath "$installRemoteModule_module")" + rm -rf "$CONFIGURE_FILE" + installRemoteModule_manuallyInstalled=0 + installRemoteModule_cppflags='' + installRemoteModule_ini_basename='' + installRemoteModule_ini_extra='' + case "$installRemoteModule_module" in + amqp) + if test -z "$installRemoteModule_version"; then + if test "$DISTRO_VERSION" = debian@8; then + # in Debian Jessie we have librabbitmq version 0.5.2 + installRemoteModule_version=1.9.3 + elif test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version=1.9.4 + fi + fi + ;; + apcu) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=4.0.11 + fi + fi + ;; + apcu_bc) + # apcu_bc must be loaded after apcu + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + ast) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.0.16 + fi + fi + ;; + blackfire) + case $(uname -m) in + i386 | i686 | x86) + installRemoteModule_tmp1=i386 + ;; + aarch64 | arm64 | armv8) + installRemoteModule_tmp1=arm64 + ;; + *) + installRemoteModule_tmp1=amd64 + ;; + esac + case $DISTRO in + alpine) + installRemoteModule_distro=alpine + ;; + *) + installRemoteModule_distro=linux + ;; + esac + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" + cd "$installRemoteModule_tmp" + curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz + mv blackfire-*.so $(getPHPExtensionsDir)/blackfire.so + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + installRemoteModule_ini_extra="$(printf '%sblackfire.agent_socket=tcp://blackfire:8307\n' "$installRemoteModule_ini_extra")" + ;; + cassandra) + installRemoteModule_src="$(getPackageSource https://github.com/nano-interactive/ext-cassandra/tarball/1cf12c5ce49ed43a2c449bee4b7b23ce02a37bf0)" + cd "$installRemoteModule_src/ext" + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + ;; + cmark) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.1.0 + fi + fi + if ! test -e /usr/local/lib/libcmark.so && ! test -e /usr/local/lib64/libcmark.so && ! test -e /usr/lib/libcmark.so && ! test -e /usr/lib64/libcmark.so && ! test -e /lib/libcmark.so; then + if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then + installRemoteModule_tmp=0.29.0 + else + installRemoteModule_tmp=0.30.3 + fi + cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" + make -s -j$(getProcessorCount) cmake_build + make -s -j$(getProcessorCount) install + cd - >/dev/null + case "$DISTRO" in + alpine) + if test -e /usr/local/lib64/libcmark.so.$installRemoteModule_tmp && ! test -e /usr/local/lib/libcmark.so.$installRemoteModule_tmp; then + ln -s /usr/local/lib64/libcmark.so.$installRemoteModule_tmp /usr/local/lib/ + fi + ;; + *) + ldconfig || true + ;; + esac + fi + ;; + csv) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=0.3.1 + fi + fi + ;; + ddtrace) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.75.0 + fi + fi + ;; + decimal) + case "$DISTRO" in + alpine) + if ! test -f /usr/local/lib/libmpdec.so; then + installRemoteModule_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure --disable-cxx + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + ;; + esac + ;; + ds) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=1.3.0 + fi + fi + ;; + event) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then + # Enable internal debugging in Event + addConfigureOption enable-event-debug no + # Enable sockets support in Event + if php --ri sockets >/dev/null 2>/dev/null; then + addConfigureOption enable-event-sockets yes + else + addConfigureOption enable-event-sockets no + fi + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in Event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # PHP Namespace for all Event classes + if test -n "${IPE_EVENT_NAMESPACE:-}"; then + addConfigureOption with-event-ns "$IPE_EVENT_NAMESPACE" + else + addConfigureOption with-event-ns no + fi + # openssl installation prefix + addConfigureOption with-openssl-dir yes + elif test $(compareVersions "$installRemoteModule_version" 1.7.6) -ge 0; then + # Enable internal debugging in Event + addConfigureOption enable-event-debug no + # Enable sockets support in Event + if php --ri sockets >/dev/null 2>/dev/null; then + addConfigureOption enable-event-sockets yes + else + addConfigureOption enable-event-sockets no + fi + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in Event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # openssl installation prefix + addConfigureOption with-openssl-dir no + elif test $(compareVersions "$installRemoteModule_version" 1.3.0) -ge 0; then + # Enable internal debugging in event + addConfigureOption enable-event-debug no + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # openssl installation prefix + addConfigureOption with-openssl-dir no + fi + # event must be loaded after sockets + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + excimer) + if test -z "$installRemoteModule_version"; then + if test "$DISTRO" = alpine && test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.0.4 + fi + fi + ;; + gearman) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.2 + fi + fi + case "$DISTRO" in + alpine) + if ! test -e /usr/local/include/libgearman/gearman.h || ! test -e /usr/local/lib/libgearman.so; then + installRemoteModule_src="$(getPackageSource https://github.com/gearman/gearmand/releases/download/1.1.20/gearmand-1.1.20.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure + make -j$(getProcessorCount) install-binPROGRAMS + make -j$(getProcessorCount) install-nobase_includeHEADERS + cd - >/dev/null + fi + ;; + esac + ;; + geoip) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + geos) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=71b5f9001512e16d3cf4657b517e8a051d6ef36f + fi + installRemoteModule_src="$(getPackageSource https://git.osgeo.org/gitea/geos/php-geos/archive/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + ./autogen.sh + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + geospatial) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.2.1 + else + installRemoteModule_version=beta + fi + fi + ;; + gmagick) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.7RC3 + else + installRemoteModule_version=beta + fi + fi + ;; + grpc) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.33.1 + fi + fi + if test -z "$installRemoteModule_version" || test "$installRemoteModule_version" = 1.35.0; then + case "$DISTRO_VERSION" in + alpine@3.13) + installRemoteModule_cppflags='-Wno-maybe-uninitialized' + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + installRemoteModule_version=1.46.3 + ;; + esac + fi + ;; + http) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.6.0 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=3.2.4 + fi + fi + if test $PHP_MAJMIN_VERSION -ge 700; then + if ! test -e /usr/local/lib/libidnkit.so; then + installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" + cd -- "$installRemoteModule_src" + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + fi + fi + # http must be loaded after raphf and propro + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + igbinary) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.8 + fi + fi + ;; + inotify) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.1.6 + fi + fi + ;; + ion) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=alpha + fi + if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then + echo 'Installing ion-c... ' + installRemoteModule_src="$(mktemp -p /tmp/src -d)" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.1 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + ( + cd "$installRemoteModule_src/ion" + git submodule init -q + git submodule update -q + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + make clean + make -j$(getProcessorCount) install + ) + rm -rf "$installRemoteModule_src" + fi + addConfigureOption with-ion "shared,/usr/local" + ;; + ioncube_loader) + installIonCubeLoader + installRemoteModule_manuallyInstalled=1 + ;; + jsmin) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=2.0.1 + fi + fi + ;; + luasandbox) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 702; then + installRemoteModule_version=3.0.3 + fi + fi + ;; + lz4) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.4.3 + fi + installRemoteModule_src="$(getPackageSource https://github.com/kjdev/php-ext-lz4/archive/refs/tags/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + phpize + ./configure --with-lz4-includedir=/usr + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + lzf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 702; then + installRemoteModule_version=1.6.8 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Sacrifice speed in favour of compression ratio? + case "${IPE_LZF_BETTERCOMPRESSION:-}" in + 1 | y* | Y*) + addConfigureOption 'enable-lzf-better-compression' 'yes' + ;; + *) + addConfigureOption 'enable-lzf-better-compression' 'no' + ;; + esac + fi + ;; + mailparse) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.1.6 + elif test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=3.1.3 + fi + fi + ;; + memcache) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.2.7 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=4.0.5.2 + fi + fi + ;; + memcached) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.2.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + # Set the path to libmemcached install prefix + addConfigureOption 'with-libmemcached-dir' 'no' + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '3.0.0') -ge 0; then + # Set the path to ZLIB install prefix + addConfigureOption 'with-zlib-dir' 'no' + # Use system FastLZ library + addConfigureOption 'with-system-fastlz' 'no' + # Enable memcached igbinary serializer support + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption 'enable-memcached-igbinary' 'yes' + else + addConfigureOption 'enable-memcached-igbinary' 'no' + fi + # Enable memcached msgpack serializer support + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption 'enable-memcached-msgpack' 'yes' + else + addConfigureOption 'enable-memcached-msgpack' 'no' + fi + # Enable memcached json serializer support + addConfigureOption 'enable-memcached-json' 'yes' + # Enable memcached protocol support + addConfigureOption 'enable-memcached-protocol' 'no' # https://github.com/php-memcached-dev/php-memcached/issues/418#issuecomment-449587972 + # Enable memcached sasl support + addConfigureOption 'enable-memcached-sasl' 'yes' + # Enable memcached session handler support + addConfigureOption 'enable-memcached-session' 'yes' + fi + # memcached must be loaded after msgpack + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + memprof) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.0 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.0 + fi + fi + ;; + mongo) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Build with Cyrus SASL (MongoDB Enterprise Authentication) support? + addConfigureOption '-with-mongo-sasl' 'yes' + fi + ;; + mongodb) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version=1.5.5 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.7.5 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=1.9.2 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.11.1 + fi + fi + ;; + mosquitto) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + msgpack) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.5.7 + fi + fi + ;; + oauth) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.2.3 + fi + fi + ;; + opencensus) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=alpha + fi + ;; + openswoole) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 704; then + installRemoteModule_version=4.10.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if php --ri sockets >/dev/null 2>/dev/null; then + installRemoteModule_sockets=yes + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + else + installRemoteModule_sockets=no + fi + installRemoteModule_openssl=yes + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '22.8.0') -ge 0; then + #enable hook curl support? + addConfigureOption enable-hook-curl yes + # enable postgres support? + addConfigureOption with-postgres yes + else + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '4.8.0') -ge 0; then + # enable postgres support? + addConfigureOption with-postgres yes + fi + fi + ;; + parallel) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=0.8.3 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=1.1.4 + fi + fi + ;; + parle) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + pcov) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=0.9.0 + fi + fi + ;; + php_trie) + if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then + installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" + mkdir -p /usr/local/include/hat-trie + mv "$installRemoteModule_src/include" /usr/local/include/hat-trie + fi + ;; + propro) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.2 + fi + fi + ;; + protobuf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=3.12.4 + else + # see https://github.com/protocolbuffers/protobuf/issues/10619 + installRemoteModule_version=3.21.6 + fi + fi + ;; + pthreads) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.10 + fi + fi + ;; + raphf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.2 + fi + fi + ;; + rdkafka) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + installRemoteModule_version1='' + if test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version1=3.0.5 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version1=4.1.2 + fi + installRemoteModule_version2='' + case "$DISTRO" in + alpine) + installRemoteModule_tmp='librdkafka' + ;; + debian) + installRemoteModule_tmp='librdkafka*' + ;; + *) + installRemoteModule_tmp='' + ;; + esac + if test -n "$installRemoteModule_tmp"; then + installRemoteModule_tmp="$(getInstalledPackageVersion "$installRemoteModule_tmp")" + if test -n "$installRemoteModule_tmp" && test $(compareVersions "$installRemoteModule_tmp" '0.11.0') -lt 0; then + installRemoteModule_version2=3.1.3 + fi + fi + if test -z "$installRemoteModule_version1" || test -z "$installRemoteModule_version2"; then + installRemoteModule_version="$installRemoteModule_version1$installRemoteModule_version2" + elif test $(compareVersions "$installRemoteModule_version1" "$installRemoteModule_version2") -le 0; then + installRemoteModule_version="$installRemoteModule_version1" + else + installRemoteModule_version="$installRemoteModule_version2" + fi + fi + ;; + redis) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=4.3.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + # Enable igbinary serializer support? + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption 'enable-redis-igbinary' 'yes' + else + addConfigureOption 'enable-redis-igbinary' 'no' + fi + # Enable lzf compression support? + addConfigureOption 'enable-redis-lzf' 'yes' + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '5.0.0') -ge 0; then + if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$TARGET_TRIPLET/libzstd.so"; then + installRemoteModule_zstdVersion=1.4.4 + installRemoteModule_zstdVersionMajor=$(echo $installRemoteModule_zstdVersion | cut -d. -f1) + rm -rf /tmp/src/zstd + mv "$(getPackageSource https://github.com/facebook/zstd/releases/download/v$installRemoteModule_zstdVersion/zstd-$installRemoteModule_zstdVersion.tar.gz)" /tmp/src/zstd + cd /tmp/src/zstd + make V=0 -j$(getProcessorCount) lib + cp -f lib/libzstd.so "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" + ln -sf "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersionMajor" + ln -sf "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" "/usr/lib/$TARGET_TRIPLET/libzstd.so" + ln -sf /tmp/src/zstd/lib/zstd.h /usr/include/zstd.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h" + cd - >/dev/null + fi + # Enable zstd compression support? + addConfigureOption 'enable-redis-zstd' 'yes' + fi + ;; + relay) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version="$(curl -sSLf https://builds.r2.relay.so/meta/latest)" + installRemoteModule_version="${installRemoteModule_version#v}" + fi + case $(uname -m) in + aarch64 | arm64 | armv8) + installRemoteModule_hardware=aarch64 + ;; + *) + installRemoteModule_hardware=x86-64 + ;; + esac + printf 'Downloading relay v%s (%s)... ' "$installRemoteModule_version" "$installRemoteModule_hardware" + installRemoteModule_url="https://builds.r2.relay.so/v${installRemoteModule_version}/relay-v${installRemoteModule_version}-php${PHP_MAJDOTMIN_VERSION}-${DISTRO}-${installRemoteModule_hardware}.tar.gz" + installRemoteModule_src="$(getPackageSource $installRemoteModule_url)" + echo 'done.' + cp -- "$installRemoteModule_src/relay-pkg.so" "$PHP_EXTDIR/relay.so" + sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" "$PHP_EXTDIR/relay.so" + installRemoteModule_ini_extra="$(grep -vE '^[ \t]*extension[ \t]*=' $installRemoteModule_src/relay.ini)" + installRemoteModule_manuallyInstalled=1 + ;; + snappy) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.2.1 + fi + installRemoteModule_src="$(getPackageSource https://github.com/kjdev/php-ext-snappy/archive/refs/tags/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + phpize + ./configure --with-snappy-includedir=/usr + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + snuffleupagus) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.8.2 + fi + installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" + cd "$installRemoteModule_src/src" + phpize + ./configure --enable-snuffleupagus + make -j$(getProcessorCount) install + cd - >/dev/null + cp -a "$installRemoteModule_src/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules" + if test $(compareVersions "$installRemoteModule_version" 0.8.0) -ge 0; then + printf '\n# Disable "PHP version is not officially maintained anymore" message\nsp.global.show_old_php_warning.disable();\n' >>"$PHP_INI_DIR/conf.d/snuffleupagus.rules" + fi + else + if test -f "$installRemoteModule_path/config/default.rules"; then + cp -a "$installRemoteModule_path/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules" + fi + fi + installRemoteModule_ini_extra="$(printf '%ssp.configuration_file=%s\n' "$installRemoteModule_ini_extra" "$PHP_INI_DIR/conf.d/snuffleupagus.rules")" + installRemoteModule_manuallyInstalled=1 + ;; + sodium | libsodium) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=1.0.7 + fi + fi + ;; + solr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.4.0 + fi + fi + ;; + sourceguardian) + installSourceGuardian + installRemoteModule_manuallyInstalled=1 + ;; + spx) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=v0.4.13 + fi + if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then + installRemoteModule_displayVersion="$installRemoteModule_version" + else + installRemoteModule_displayVersion="git--master-$installRemoteModule_version" + fi + installRemoteModule_src="$(getPackageSource https://codeload.github.com/NoiseByNorthwest/php-spx/tar.gz/$installRemoteModule_version)" + cd -- "$installRemoteModule_src" + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + sqlsrv | pdo_sqlsrv) + isMicrosoftSqlServerODBCInstalled || installMicrosoftSqlServerODBC + if test -z "$installRemoteModule_version"; then + # https://docs.microsoft.com/it-it/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-2017 + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=3.0.1 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=5.3.0 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=5.6.1 + elif test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=5.8.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=5.9.0 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=5.10.1 + fi + fi + ;; + ssh2) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.13 + else + installRemoteModule_version=beta + fi + fi + ;; + stomp) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.9 + fi + fi + if test "$DISTRO" = debian; then + addConfigureOption with-openssl-dir yes + else + addConfigureOption with-openssl-dir /usr + fi + ;; + swoole) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 502; then + installRemoteModule_version=1.6.10 + elif test $PHP_MAJMIN_VERSION -le 504; then + installRemoteModule_version=2.0.4 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.11 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=4.3.6 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=4.5.10 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=4.8.11 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if php --ri sockets >/dev/null 2>/dev/null; then + installRemoteModule_sockets=yes + else + installRemoteModule_sockets=no + fi + installRemoteModule_openssl=yes + case "$DISTRO_VERSION" in + alpine@3.7 | alpine@3.8) + if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + # see https://github.com/swoole/swoole-src/issues/3934 + installRemoteModule_openssl=no + fi + ;; + esac + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + elif test $(compareVersions "$installRemoteModule_version" 5.0.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + elif test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + elif test $(compareVersions "$installRemoteModule_version" 4.6.1) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.11) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.7) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + # enable kernel debug/trace log? (it will degrade performance) + addConfigureOption enable-debug-log no + elif test $(compareVersions "$installRemoteModule_version" 4.2.6) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-debug-log no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.0) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-debug-log no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 2.1.2) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-swoole-debug no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 1.10.4) -ge 0 && test $(compareVersions "$installRemoteModule_version" 1.10.5) -le 0; then + # enable debug/trace log support? + addConfigureOption enable-swoole-debug no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + fi + ;; + tdlib) + if ! test -f /usr/lib/libphpcpp.so || ! test -f /usr/include/phpcpp.h; then + if test $PHP_MAJMIN_VERSION -le 701; then + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/v2.1.4)" + elif test $PHP_MAJMIN_VERSION -le 703; then + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/v2.2.0)" + else + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/444d1f90cf6b7f3cb5178fa0d0b5ab441b0389d0)" + fi + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + if test -z "$installRemoteModule_path"; then + installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" + git clone --depth=1 --recurse-submodules https://github.com/yaroslavche/phptdlib.git "$installRemoteModule_tmp" + mkdir "$installRemoteModule_tmp/build" + cd "$installRemoteModule_tmp/build" + cmake -D USE_SHARED_PHPCPP:BOOL=ON .. + make + make install + cd - >/dev/null + rm "$PHP_INI_DIR/conf.d/tdlib.ini" + installRemoteModule_manuallyInstalled=1 + fi + ;; + tensor) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=2.2.3 + fi + fi + ;; + uopz) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.7 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=5.0.2 + elif test $PHP_MAJMIN_VERSION -le 740; then + installRemoteModule_version=6.1.2 + fi + fi + ;; + uploadprogress) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.1.4 + fi + fi + ;; + uuid) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.5 + fi + fi + ;; + xdebug) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 500; then + installRemoteModule_version=2.0.5 + elif test $PHP_MAJMIN_VERSION -le 503; then + installRemoteModule_version=2.2.7 + elif test $PHP_MAJMIN_VERSION -le 504; then + installRemoteModule_version=2.4.1 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.5.5 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.6.1 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=2.9.8 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=3.1.6 + fi + fi + ;; + xdiff) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.5.2 + fi + fi + if ! test -f /usr/local/lib/libxdiff.* && ! test -f /usr/lib/libxdiff.* && ! test -f /usr/lib/x86_64*/libxdiff.*; then + installRemoteModule_src="$(getPackageSource https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/assets/resources/libxdiff-0.23.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure --disable-shared --disable-dependency-tracking --with-pic + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + ;; + xhprof) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.9.4 + fi + fi + ;; + xlswriter) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.2.7) -ge 0; then + # enable reader supports? + addConfigureOption enable-reader yes + fi + ;; + xmlrpc) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + yac) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.9.2 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.2.0) -ge 0; then + # Enable igbinary serializer support + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption enable-igbinary yes + else + addConfigureOption enable-igbinary no + fi + # Enable json serializer support + if php --ri json >/dev/null 2>/dev/null; then + addConfigureOption enable-json yes + else + addConfigureOption enable-json no + fi + # Enable msgpack serializer support + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption enable-msgpack yes + else + addConfigureOption enable-msgpack no + fi + fi + ;; + yaml) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.3.1 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.0.4 + fi + fi + ;; + yar) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.2.5 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.2.4) -ge 0; then + # Enable Msgpack Supports + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption enable-msgpack yes + else + addConfigureOption enable-msgpack no + fi + fi + ;; + zmq) + if test -z "$installRemoteModule_version"; then + installRemoteModule_src="$(getPackageSource https://github.com/zeromq/php-zmq/tarball/master)" + cd "$installRemoteModule_src" + phpize + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + zookeeper) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.5.0 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=1.0.0 + else + installRemoteModule_version=alpha + fi + fi + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + case "$DISTRO" in + alpine) + if ! test -f /usr/local/include/zookeeper/zookeeper.h; then + if test $(compareVersions "$installRemoteModule_version" 1.0.0) -lt 0; then + installRemoteModule_src="$(getPackageSource http://archive.apache.org/dist/zookeeper/zookeeper-3.5.9/apache-zookeeper-3.5.9.tar.gz)" + else + installRemoteModule_tmp="$(curl -sSLf https://downloads.apache.org/zookeeper/stable | sed -E 's/["<>]/\n/g' | grep -E '^(apache-)?zookeeper-[0-9]+\.[0-9]+\.[0-9]+\.(tar\.gz|tgz)$' | head -n1)" + if test -z "$installRemoteModule_tmp"; then + echo 'Failed to detect the zookeeper library URL' >&2 + exit 1 + fi + installRemoteModule_src="$(getPackageSource https://downloads.apache.org/zookeeper/stable/$installRemoteModule_tmp)" + fi + cd -- "$installRemoteModule_src" + if test -d ~/.m2; then + installRemoteModule_delm2=n + else + installRemoteModule_delm2=y + fi + mvn -pl zookeeper-jute compile + cd - >/dev/null + cd -- "$installRemoteModule_src/zookeeper-client/zookeeper-client-c" + autoreconf -if + ./configure --without-cppunit + make -j$(getProcessorCount) CFLAGS='-Wno-stringop-truncation -Wno-format-overflow' + make install + cd - >/dev/null + if test $installRemoteModule_delm2 = y; then + rm -rf ~/.m2 + fi + fi + ;; + esac + ;; + zstd) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.11.0 + fi + fi + ;; + esac + if test $installRemoteModule_manuallyInstalled -eq 0; then + if test -n "$installRemoteModule_path"; then + printf ' (installing version %s from %s)\n' "$installRemoteModule_version" "$installRemoteModule_path" + elif test -n "$installRemoteModule_version"; then + printf ' (installing version %s)\n' "$installRemoteModule_version" + fi + installPeclPackage "$installRemoteModule_module" "$installRemoteModule_version" "$installRemoteModule_cppflags" "$installRemoteModule_path" + fi + postProcessModule "$installRemoteModule_module" + checkModuleWorking "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra" + enablePhpExtension "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra" +} + +# Check if a module/helper may be installed using the pecl archive +# +# Arguments: +# $1: the name of the module +# +# Return: +# 0: true +# 1: false +moduleMayUsePecl() { + case "$1" in + @composer | @fix_letsencrypt) + return 1 + ;; + blackfire | geos | ioncube_loader | snuffleupagus | sourceguardian | spx | tdlib) + return 1 + ;; + esac + if test -n "$(getModuleSourceCodePath "$1")"; then + return 1 + fi + if stringInList "$1" "$BUNDLED_MODULES"; then + return 1 + fi + return 0 +} + +# Configure the PECL package installer +# +# Updates: +# PHP_MODULES_TO_INSTALL +# Sets: +# USE_PICKLE 0: no, 1: yes (already downloaded), 2: yes (build it from source) +configureInstaller() { + USE_PICKLE=0 + if ! which pecl >/dev/null; then + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do + if ! moduleMayUsePecl "$PHP_MODULE_TO_INSTALL"; then + continue + fi + if false && anyStringInList '' "$PHP_MODULES_TO_INSTALL"; then + USE_PICKLE=2 + else + curl -sSLf https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /tmp/pickle + chmod +x /tmp/pickle + USE_PICKLE=1 + fi + break + done + fi + if test $USE_PICKLE -eq 0; then + if test -z "$(pear config-get http_proxy)"; then + if test -n "${http_proxy:-}"; then + pear config-set http_proxy "$http_proxy" || true + elif test -n "${HTTP_PROXY:-}"; then + pear config-set http_proxy "$HTTP_PROXY" || true + fi + fi + pecl channel-update pecl.php.net || true + fi +} + +buildPickle() { + printf '### BUILDING PICKLE ###\n' + buildPickle_tempDir="$(mktemp -p /tmp/src -d)" + cd -- "$buildPickle_tempDir" + printf 'Downloading... ' + git clone --quiet --depth 1 https://github.com/FriendsOfPHP/pickle.git . + git tag 0.7.0 + printf 'done.\n' + printf 'Installing composer... ' + actuallyInstallComposer . composer '--1 --quiet' + printf 'done.\n' + printf 'Installing composer dependencies... ' + ./composer install --no-dev --no-progress --no-suggest --optimize-autoloader --ignore-platform-reqs --quiet --no-cache + printf 'done.\n' + printf 'Building... ' + php -d phar.readonly=0 box.phar build + mv pickle.phar /tmp/pickle + printf 'done.\n' + cd - >/dev/null +} + +# Add a configure option for the pecl/pickle install command +# +# Arguments: +# $1: the option name +# $2: the option value +addConfigureOption() { + if test $USE_PICKLE -eq 0; then + printf -- '%s\n' "$2" >>"$CONFIGURE_FILE" + else + printf -- '--%s=%s\n' "$1" "$2" >>"$CONFIGURE_FILE" + fi +} + +# Actually installs a PECL package +# +# Arguments: +# $1: the package to be installed +# $2: the package version to be installed (optional) +# $3: the value of the CPPFLAGS variable (optional) +# $4: the path of the local package to be installed (optional, downloaded from PECL if omitted/empty) +installPeclPackage() { + if ! test -f "$CONFIGURE_FILE"; then + printf '\n' >"$CONFIGURE_FILE" + fi + installPeclPackage_name="$(getPeclModuleName "$1")" + if test -z "${2:-}"; then + installPeclPackage_fullname="$installPeclPackage_name" + else + installPeclPackage_fullname="$installPeclPackage_name-$2" + fi + installPeclPackage_path="${4:-}" + if test -z "$installPeclPackage_path"; then + installPeclPackage_path="$installPeclPackage_fullname" + fi + if test $USE_PICKLE -eq 0; then + if test -n "${4:-}"; then + if test -f "$installPeclPackage_path/package2.xml"; then + installPeclPackage_path="$installPeclPackage_path/package2.xml" + else + installPeclPackage_path="$installPeclPackage_path/package.xml" + fi + fi + cat "$CONFIGURE_FILE" | MAKE="make -j$(getCompilationProcessorCount $1)" CPPFLAGS="${3:-}" pecl install "$installPeclPackage_path" + else + MAKEFLAGS="-j$(getCompilationProcessorCount $1)" CPPFLAGS="${3:-}" /tmp/pickle install --tmp-dir=/tmp/pickle.tmp --no-interaction --version-override='' --with-configure-options "$CONFIGURE_FILE" -- "$installPeclPackage_path" + fi +} + +# Check if a string is in a list of space-separated string +# +# Arguments: +# $1: the string to be checked +# $2: the string list +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +stringInList() { + for stringInList_listItem in $2; do + if test "$1" = "$stringInList_listItem"; then + return 0 + fi + done + return 1 +} + +# Check if at least one item in a list is in another list +# +# Arguments: +# $1: the space-separated list of items to be searched +# $2: the space-separated list of reference items +# +# Return: +# 0 (true): at least one of the items in $1 is in $2 +# 1 (false): otherwise +anyStringInList() { + for anyStringInList_item in $1; do + if stringInList "$anyStringInList_item" "$2"; then + return 0 + fi + done + return 1 +} + +# Remove a word from a space-separated list +# +# Arguments: +# $1: the word to be removed +# $2: the string list +# +# Output: +# The list without the word +removeStringFromList() { + removeStringFromList_result='' + for removeStringFromList_listItem in $2; do + if test "$1" != "$removeStringFromList_listItem"; then + if test -z "$removeStringFromList_result"; then + removeStringFromList_result="$removeStringFromList_listItem" + else + removeStringFromList_result="$removeStringFromList_result $removeStringFromList_listItem" + fi + fi + done + printf '%s' "$removeStringFromList_result" +} + +# Invoke apt-get update +# +# Set: +# IPE_APTGET_INSTALLOPTIONS +invokeAptGetUpdate() { + if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then + DEBIAN_FRONTEND=noninteractive apt-get update -q + return + fi + IPE_APTGET_INSTALLOPTIONS='' + if ! grep -q 'VERSION="8 (jessie)"' /etc/os-release; then + DEBIAN_FRONTEND=noninteractive apt-get update -q + return + fi + invokeAptGetUpdate_tmp="$(mktemp)" + DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + if test -s "$invokeAptGetUpdate_tmp"; then + cat "$invokeAptGetUpdate_tmp" >&2 + if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then + IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' + echo '############' >&2 + echo '# WARNING! #' >&2 + echo '############' >&2 + echo 'apt packages will be installed without checking authenticity!' >&2 + fi + fi + rm "$invokeAptGetUpdate_tmp" + IPE_APTGETUPDATE_ALREADY=y +} + +# Fix the Let's Encrypt CA certificates on old distros +fixLetsEncrypt() { + printf '### FIXING LETS ENCRYPT CA CERTIFICATES ###\n' + case "$DISTRO_VERSION" in + alpine@3.7 | alpine@3.8) + printf -- '- old Alpine Linux detected: we should fix the certificates\n' + ;; + debian@8 | debian@9) + printf -- '- old Debian detected: we should fix the certificates\n' + if ! grep -q 'mozilla/ISRG_Root_X1.crt' /etc/ca-certificates.conf && grep -q 'mozilla/DST_Root_CA_X3.crt' /etc/ca-certificates.conf; then + printf -- '- old ca-certificates package detected\n' + fixCACerts_mustUpdate=1 + if test -d /var/lib/apt/lists; then + for fixCACerts_item in $(ls -1 /var/lib/apt/lists); do + case "$fixCACerts_item" in + partial | lock) ;; + *) + fixCACerts_mustUpdate=0 + break + ;; + esac + done + fi + if test $fixCACerts_mustUpdate -eq 1; then + printf -- '- refreshing the APT package list\n' + invokeAptGetUpdate + fi + printf -- '- installing newer ca-certificates package\n' + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS ca-certificates + fi + ;; + *) + printf -- '- patch not required in this distro version\n' + return + ;; + esac + if grep -Eq '^mozilla/ISRG_Root_X1\.crt$' /etc/ca-certificates.conf && grep -Eq '^mozilla/DST_Root_CA_X3\.crt$' /etc/ca-certificates.conf; then + printf -- '- disabling the DST_Root_CA_X3 certificate\n' + sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf + printf -- '- refreshing the certificates\n' + update-ca-certificates -f + else + printf -- '- DST_Root_CA_X3 certificate not found or already disabled\n' + fi +} + +# Cleanup everything at the end of the execution +cleanup() { + if test -n "$UNNEEDED_PACKAGE_LINKS"; then + printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' + for cleanup_link in $UNNEEDED_PACKAGE_LINKS; do + if test -L "$cleanup_link"; then + rm -f "$cleanup_link" + fi + done + fi + if test -n "$PACKAGES_VOLATILE"; then + printf '### REMOVING UNNEEDED PACKAGES ###\n' + case "$DISTRO" in + alpine) + apk del --purge $PACKAGES_VOLATILE + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + ;; + esac + fi + if test -n "$PACKAGES_PREVIOUS"; then + case "$DISTRO" in + debian) + printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + ;; + esac + fi + docker-php-source delete + rm -rf /tmp/src + rm -rf /tmp/pickle + rm -rf /tmp/pickle.tmp + rm -rf "$CONFIGURE_FILE" + case "${IPE_KEEP_SYSPKG_CACHE:-}" in + 1 | y* | Y*) ;; + *) + case "$DISTRO" in + alpine) + rm -rf /var/cache/apk/* + ;; + debian) + rm -rf /var/lib/apt/lists/* + ;; + esac + rm -rf /tmp/pear + ;; + esac +} + +resetIFS +mkdir -p /tmp/src +mkdir -p /tmp/pickle.tmp +IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)" +CONFIGURE_FILE=/tmp/configure-options +IPE_APK_FLAGS='' +setDistro +case "$DISTRO_VERSION" in + debian@8) + fixMaxOpenFiles || true + ;; +esac +setPHPVersionVariables +setPHPPreinstalledModules +case "$PHP_MAJMIN_VERSION" in + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802) ;; + *) + printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) + ;; +esac +UNNEEDED_PACKAGE_LINKS='' +processCommandArguments "$@" + +if test -z "$PHP_MODULES_TO_INSTALL"; then + exit 0 +fi + +if stringInList @fix_letsencrypt "$PHP_MODULES_TO_INSTALL"; then + # This must be the very first thing we do + fixLetsEncrypt +fi + +sortModulesToInstall + +docker-php-source extract +BUNDLED_MODULES="$(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | xargs -n1 dirname | xargs -n1 basename | xargs)" +configureInstaller + +buildRequiredPackageLists $PHP_MODULES_TO_INSTALL +if test -n "$PACKAGES_PERSISTENT_PRE"; then + markPreinstalledPackagesAsUsed +fi +if test -n "$PACKAGES_PERSISTENT_NEW$PACKAGES_VOLATILE"; then + installRequiredPackages +fi +if test "$PHP_MODULES_TO_INSTALL" != '@composer'; then + setTargetTriplet +fi +if test $USE_PICKLE -gt 1; then + buildPickle +fi +for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do + case "$PHP_MODULE_TO_INSTALL" in + @fix_letsencrypt) + # Already done: it must be the first thing we do + ;; + @composer) + installComposer + ;; + *) + if stringInList "$PHP_MODULE_TO_INSTALL" "$BUNDLED_MODULES"; then + installBundledModule "$PHP_MODULE_TO_INSTALL" + else + installRemoteModule "$PHP_MODULE_TO_INSTALL" + fi + ;; + esac +done +cleanup diff --git a/apps/php5/versions/5.6.40/build/php/extensions/install.sh b/apps/php5/versions/5.6.40/build/php/extensions/install.sh new file mode 100644 index 00000000..010897d6 --- /dev/null +++ b/apps/php5/versions/5.6.40/build/php/extensions/install.sh @@ -0,0 +1,731 @@ +#!/bin/sh + +export MC="-j$(nproc)" + +echo +echo "============================================" +echo "Install extensions from : install.sh" +echo "PHP version : ${PHP_VERSION}" +echo "Extra Extensions : ${PHP_EXTENSIONS}" +echo "Multicore Compilation : ${MC}" +echo "Container package url : ${CONTAINER_PACKAGE_URL}" +echo "Work directory : ${PWD}" +echo "============================================" +echo + + +if [ "${PHP_EXTENSIONS}" != "" ]; then + apk --update add --no-cache --virtual .build-deps autoconf g++ libtool make curl-dev gettext-dev linux-headers +fi + + +export EXTENSIONS=",${PHP_EXTENSIONS}," + + +# +# Check if current php version is greater than or equal to +# specific version. +# +# For example, to check if current php is greater than or +# equal to PHP 7.0: +# +# isPhpVersionGreaterOrEqual 7 0 +# +# Param 1: Specific PHP Major version +# Param 2: Specific PHP Minor version +# Return : 1 if greater than or equal to, 0 if less than +# +isPhpVersionGreaterOrEqual() + { + local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;") + local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;") + + if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then + return 1; + else + return 0; + fi +} + + +# +# Install extension from package file(.tgz), +# For example: +# +# installExtensionFromTgz redis-5.2.2 +# +# Param 1: Package name with version +# Param 2: enable options +# +installExtensionFromTgz() +{ + tgzName=$1 + para1= + extensionName="${tgzName%%-*}" + + if [ $2 ]; then + para1=$2 + fi + mkdir ${extensionName} + tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 + ( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) + + docker-php-ext-enable ${extensionName} +} + + +if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then + echo "---------- Install pdo_mysql ----------" + docker-php-ext-install ${MC} pdo_mysql +fi + +if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then + echo "---------- Install pcntl ----------" + docker-php-ext-install ${MC} pcntl +fi + +if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then + echo "---------- Install mysqli ----------" + docker-php-ext-install ${MC} mysqli +fi + +if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then + echo "---------- mbstring is installed ----------" +fi + +if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then + echo "---------- Install exif ----------" + docker-php-ext-install ${MC} exif +fi + +if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then + echo "---------- Install bcmath ----------" + docker-php-ext-install ${MC} bcmath +fi + +if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then + echo "---------- Install calendar ----------" + docker-php-ext-install ${MC} calendar +fi + +if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then + echo "---------- Install zend_test ----------" + docker-php-ext-install ${MC} zend_test +fi + +if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then + echo "---------- Install opcache ----------" + docker-php-ext-install opcache +fi + +if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then + echo "---------- Install sockets ----------" + docker-php-ext-install ${MC} sockets +fi + +if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then + echo "---------- Install gettext ----------" + apk --no-cache add gettext-dev + docker-php-ext-install ${MC} gettext + +fi + +if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then + echo "---------- Install shmop ----------" + docker-php-ext-install ${MC} shmop +fi + +if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then + echo "---------- Install sysvmsg ----------" + docker-php-ext-install ${MC} sysvmsg +fi + +if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then + echo "---------- Install sysvsem ----------" + docker-php-ext-install ${MC} sysvsem +fi + +if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then + echo "---------- Install sysvshm ----------" + docker-php-ext-install ${MC} sysvshm +fi + +if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then + echo "---------- Install pdo_firebird ----------" + docker-php-ext-install ${MC} pdo_firebird +fi + +if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then + echo "---------- Install pdo_dblib ----------" + docker-php-ext-install ${MC} pdo_dblib +fi + +if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then + echo "---------- Install pdo_oci ----------" + docker-php-ext-install ${MC} pdo_oci +fi + +if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then + echo "---------- Install pdo_odbc ----------" + docker-php-ext-install ${MC} pdo_odbc +fi + +if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then + echo "---------- Install pdo_pgsql ----------" + apk --no-cache add postgresql-dev \ + && docker-php-ext-install ${MC} pdo_pgsql +fi + +if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then + echo "---------- Install pgsql ----------" + apk --no-cache add postgresql-dev \ + && docker-php-ext-install ${MC} pgsql +fi + +if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then + echo "---------- Install oci8 ----------" + docker-php-ext-install ${MC} oci8 +fi + +if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then + echo "---------- Install odbc ----------" + docker-php-ext-install ${MC} odbc +fi + +if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then + echo "---------- Install dba ----------" + docker-php-ext-install ${MC} dba +fi + +if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then + echo "---------- Install interbase ----------" + echo "Alpine linux do not support interbase/firebird!!!" + #docker-php-ext-install ${MC} interbase +fi + +if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then + echo "---------- Install hprose ----------" + printf "\n" | pecl install hprose + docker-php-ext-enable hprose +fi + +if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then + echo "---------- Install gd ----------" + isPhpVersionGreaterOrEqual 7 4 + + 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 + + apk add --no-cache \ + freetype \ + freetype-dev \ + libpng \ + libpng-dev \ + libjpeg-turbo \ + libjpeg-turbo-dev \ + libwebp-dev \ + && docker-php-ext-configure gd ${options} \ + && docker-php-ext-install ${MC} gd \ + && apk del \ + freetype-dev \ + libpng-dev \ + libjpeg-turbo-dev +fi + +if [[ -z "${EXTENSIONS##*,yaml,*}" ]]; then + echo "---------- Install yaml ----------" + apk add --no-cache yaml-dev + printf "\n" | pecl install yaml + docker-php-ext-enable yaml +fi + +if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then + echo "---------- Install intl ----------" + apk add --no-cache icu-dev + docker-php-ext-install ${MC} intl +fi + +if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then + echo "---------- Install bz2 ----------" + apk add --no-cache bzip2-dev + docker-php-ext-install ${MC} bz2 +fi + +if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then + echo "---------- Install soap ----------" + apk add --no-cache libxml2-dev + docker-php-ext-install ${MC} soap +fi + +if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then + echo "---------- Install xsl ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} xsl +fi + +if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then + echo "---------- Install xmlrpc ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} xmlrpc +fi + +if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then + echo "---------- Install wddx ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} wddx +fi + +if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then + echo "---------- curl is installed ----------" +fi + +if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then + echo "---------- Install readline ----------" + apk add --no-cache readline-dev + apk add --no-cache libedit-dev + docker-php-ext-install ${MC} readline +fi + +if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then + echo "---------- Install snmp ----------" + apk add --no-cache net-snmp-dev + docker-php-ext-install ${MC} snmp +fi + +if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then + echo "---------- Install pspell ----------" + apk add --no-cache aspell-dev + apk add --no-cache aspell-en + docker-php-ext-install ${MC} pspell +fi + +if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then + echo "---------- Install recode ----------" + apk add --no-cache recode-dev + docker-php-ext-install ${MC} recode +fi + +if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then + echo "---------- Install tidy ----------" + apk add --no-cache tidyhtml-dev + + # Fix: https://github.com/htacg/tidy-html5/issues/235 + ln -s /usr/include/tidybuffio.h /usr/include/buffio.h + + docker-php-ext-install ${MC} tidy +fi + +if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then + echo "---------- Install gmp ----------" + apk add --no-cache gmp-dev + docker-php-ext-install ${MC} gmp +fi + +if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then + echo "---------- Install imap ----------" + apk add --no-cache imap-dev + docker-php-ext-configure imap --with-imap --with-imap-ssl + docker-php-ext-install ${MC} imap +fi + +if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then + echo "---------- Install ldap ----------" + apk add --no-cache ldb-dev + apk add --no-cache openldap-dev + docker-php-ext-install ${MC} ldap +fi + +if [[ -z "${EXTENSIONS##*,psr,*}" ]]; then + echo "---------- Install psr ----------" + printf "\n" | pecl install psr + docker-php-ext-enable psr +fi + +if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then + echo "---------- Install imagick ----------" + apk add --no-cache file-dev + apk add --no-cache imagemagick-dev + printf "\n" | pecl install imagick-3.4.4 + docker-php-ext-enable imagick +fi + +if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then + echo "---------- Install rar ----------" + printf "\n" | pecl install rar + docker-php-ext-enable rar +fi + +if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then + echo "---------- Install ast ----------" + printf "\n" | pecl install ast + docker-php-ext-enable ast +fi + +if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then + echo "---------- Install msgpack ----------" + printf "\n" | pecl install msgpack + docker-php-ext-enable msgpack +fi + +if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then + echo "---------- Install igbinary ----------" + printf "\n" | pecl install igbinary + docker-php-ext-enable igbinary +fi + + +if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then + 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 >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install protobuf ----------" + printf "\n" | pecl install protobuf + docker-php-ext-enable protobuf + else + echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then + 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 >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install yar ----------" + printf "\n" | pecl install yar + docker-php-ext-enable yar + else + echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" + fi + +fi + + + +if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install yaconf ----------" + printf "\n" | pecl install yaconf + docker-php-ext-enable yaconf + else + echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then + echo "---------- Install seaslog ----------" + printf "\n" | pecl install seaslog + docker-php-ext-enable seaslog +fi + +if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then + echo "---------- Install varnish ----------" + apk add --no-cache varnish-dev + printf "\n" | pecl install varnish + docker-php-ext-enable varnish +fi + +if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then + isPhpVersionGreaterOrEqual 7 1 + if [[ "$?" = "1" ]]; then + echo "---------- Install pdo_sqlsrv ----------" + apk add --no-cache unixodbc-dev + printf "\n" | pecl install pdo_sqlsrv + docker-php-ext-enable pdo_sqlsrv + curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk + apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + else + echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then + isPhpVersionGreaterOrEqual 7 1 + if [[ "$?" = "1" ]]; then + echo "---------- Install sqlsrv ----------" + apk add --no-cache unixodbc-dev + printf "\n" | pecl install sqlsrv + docker-php-ext-enable sqlsrv + else + echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install mcrypt ----------" + apk add --no-cache libmcrypt-dev libmcrypt re2c + printf "\n" |pecl install mcrypt + docker-php-ext-enable mcrypt + else + echo "---------- Install mcrypt ----------" + apk add --no-cache libmcrypt-dev \ + && docker-php-ext-install ${MC} mcrypt + fi +fi + +if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then + 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 + isPhpVersionGreaterOrEqual 7 2 + if [[ "$?" = "1" ]]; then + echo + echo "Sodium is bundled with PHP from PHP 7.2.0" + echo + else + echo "---------- Install sodium ----------" + apk add --no-cache libsodium-dev + docker-php-ext-install ${MC} sodium + fi +fi + +if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then + echo "---------- Install amqp ----------" + apk add --no-cache rabbitmq-c-dev + installExtensionFromTgz amqp-1.10.2 +fi + +if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then + echo "---------- Install redis ----------" + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + installExtensionFromTgz redis-5.2.2 + else + printf "\n" | pecl install redis-4.3.0 + docker-php-ext-enable redis + fi +fi + +if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then + echo "---------- Install apcu ----------" + installExtensionFromTgz apcu-5.1.17 +fi + +if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then + echo "---------- Install memcached ----------" + apk add --no-cache libmemcached-dev zlib-dev + 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 ----------" + 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 ----------" + 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 + echo "---------- Install event ----------" + apk add --no-cache libevent-dev + export is_sockets_installed=$(php -r "echo extension_loaded('sockets');") + + if [[ "${is_sockets_installed}" = "" ]]; then + echo "---------- event is depend on sockets, install sockets first ----------" + docker-php-ext-install sockets + fi + + echo "---------- Install event again ----------" + installExtensionFromTgz event-2.5.6 "--ini-name event.ini" +fi + +if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then + echo "---------- Install mongodb ----------" + installExtensionFromTgz mongodb-1.7.4 +fi + +if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then + echo "---------- Install yaf ----------" + 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++ + + isPhpVersionGreaterOrEqual 7 0 + + if [[ "$?" = "1" ]]; then + installExtensionFromTgz swoole-4.5.2 + 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 + + 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 7 0 + + if [[ "$?" = "1" ]]; then + mkdir xhprof \ + && 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>= 7.0----------" + fi + +fi + +if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then + echo "---------- Install xlswriter ----------" + isPhpVersionGreaterOrEqual 7 0 + + if [[ "$?" = "1" ]]; then + printf "\n" | pecl install xlswriter + docker-php-ext-enable xlswriter + else + echo "---------- PHP Version>= 7.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then + echo "---------- Install rdkafka ----------" + isPhpVersionGreaterOrEqual 5 6 + + if [[ "$?" = "1" ]]; then + apk add librdkafka-dev + printf "\n" | pecl install rdkafka + docker-php-ext-enable rdkafka + else + echo "---------- PHP Version>= 5.6----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then + echo "---------- Install zookeeper ----------" + 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>= 7.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then + echo "---------- Install phalcon ----------" + isPhpVersionGreaterOrEqual 7 2 + + if [[ "$?" = "1" ]]; then + printf "\n" | pecl install phalcon + docker-php-ext-enable psr + docker-php-ext-enable phalcon + else + echo "---------- PHP Version>= 7.2----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then + echo "---------- Install sdebug ----------" + isPhpVersionGreaterOrEqual 7 2 + + if [[ "$?" = "1" ]]; then + curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \ + && mkdir -p sdebug \ + && tar -xf sdebug.tar.gz -C sdebug --strip-components=1 \ + && rm sdebug.tar.gz \ + && ( \ + cd sdebug \ + && phpize \ + && ./configure --enable-xdebug \ + && make clean && make && make install \ + ) \ + && docker-php-ext-enable xdebug + else + echo "---------- PHP Version>= 7.2----------" + fi +fi + +if [ "${PHP_EXTENSIONS}" != "" ]; then + apk del .build-deps \ + && docker-php-source delete +fi diff --git a/apps/php5/versions/5.6.40/build/php/php-fpm.conf b/apps/php5/versions/5.6.40/build/php/php-fpm.conf new file mode 100644 index 00000000..13183589 --- /dev/null +++ b/apps/php5/versions/5.6.40/build/php/php-fpm.conf @@ -0,0 +1,423 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or NONE) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = www-data +;listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 10 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/local/share/php/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +slowlog = /var/log/php/fpm.slow.log + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_slowlog_timeout = 3 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr/local) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/apps/php5/versions/5.6.40/build/php/php.ini b/apps/php5/versions/5.6.40/build/php/php.ini new file mode 100644 index 00000000..a8ad689c --- /dev/null +++ b/apps/php5/versions/5.6.40/build/php/php.ini @@ -0,0 +1,1933 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 256M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +error_log = /var/log/php/php.error.log + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 100M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 50M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Asia/Shanghai + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +;
is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: + +[XDebug] +xdebug.remote_enable = 1 +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 + +SERVER_ENV=develop + +yaf.use_spl_autoload=1 + +[xhprof] +;xhprof.output_dir = /var/log/php/xhprof.log \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/conf/php-fpm.conf b/apps/php5/versions/5.6.40/conf/php-fpm.conf new file mode 100644 index 00000000..13183589 --- /dev/null +++ b/apps/php5/versions/5.6.40/conf/php-fpm.conf @@ -0,0 +1,423 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or NONE) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = www-data +;listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 10 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/local/share/php/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +slowlog = /var/log/php/fpm.slow.log + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_slowlog_timeout = 3 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr/local) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/apps/php5/versions/5.6.40/conf/php.ini b/apps/php5/versions/5.6.40/conf/php.ini new file mode 100644 index 00000000..30535103 --- /dev/null +++ b/apps/php5/versions/5.6.40/conf/php.ini @@ -0,0 +1,1933 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 256M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +error_log = /var/log/php/php.error.log + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 100M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 50M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Asia/Shanghai + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: + +[XDebug] +xdebug.remote_enable = 1 +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/xdebug.log + +SERVER_ENV=develop + +yaf.use_spl_autoload=1 + +[xhprof] +;xhprof.output_dir = /var/log/php/xhprof.log \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/config.json b/apps/php5/versions/5.6.40/config.json new file mode 100644 index 00000000..f6f66c97 --- /dev/null +++ b/apps/php5/versions/5.6.40/config.json @@ -0,0 +1,13 @@ +{ + "formFields": [ + { + "type": "number", + "labelZh": "端口", + "labelEn": "Port", + "required": true, + "default": 9000, + "rule": "paramPort", + "envKey": "PANEL_APP_PORT_HTTP" + } + ] +} \ No newline at end of file diff --git a/apps/php5/versions/5.6.40/docker-compose.yml b/apps/php5/versions/5.6.40/docker-compose.yml new file mode 100644 index 00000000..6e019077 --- /dev/null +++ b/apps/php5/versions/5.6.40/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3" +services: + php: + image: ${IMAGE_NAME} + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + volumes: + - ${PANEL_WEBSITE_DIR}:/www/ + - ./conf/php.ini:/usr/local/etc/php/php.ini + - ./conf/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf + - ./log:/var/log/php + - ./composer:/tmp/composer + ports: + - ${PANEL_APP_PORT_HTTP}:9000 +networks: + 1panel-network: + external: true \ No newline at end of file diff --git a/apps/php7/metadata/logo.png b/apps/php7/metadata/logo.png new file mode 100644 index 00000000..569fc644 Binary files /dev/null and b/apps/php7/metadata/logo.png differ diff --git a/apps/php7/versions/7.4.33/README.md b/apps/php7/versions/7.4.33/README.md new file mode 100644 index 00000000..85cdf6c3 --- /dev/null +++ b/apps/php7/versions/7.4.33/README.md @@ -0,0 +1,141 @@ + + +# The PHP Interpreter + +PHP is a popular general-purpose scripting language that is especially suited to +web development. Fast, flexible and pragmatic, PHP powers everything from your +blog to the most popular websites in the world. PHP is distributed under the +[PHP License v3.01](LICENSE). + +[![Push](https://github.com/php/php-src/actions/workflows/push.yml/badge.svg)](https://github.com/php/php-src/actions/workflows/push.yml) +[![Build status](https://travis-ci.com/php/php-src.svg?branch=master)](https://travis-ci.com/github/php/php-src) +[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy/branch/master?svg=true)](https://ci.appveyor.com/project/php/php-src) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/php.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:php) + +## Documentation + +The PHP manual is available at [php.net/docs](https://php.net/docs). + +## Installation + +### Prebuilt packages and binaries + +Prebuilt packages and binaries can be used to get up and running fast with PHP. + +For Windows, the PHP binaries can be obtained from +[windows.php.net](https://windows.php.net). After extracting the archive the +`*.exe` files are ready to use. + +For other systems, see the [installation chapter](https://php.net/install). + +### Building PHP source code + +*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).* + +For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For +a default build, you will additionally need libxml2 and libsqlite3. + +On Ubuntu, you can install these using: + + sudo apt install -y pkg-config build-essential autoconf bison re2c \ + libxml2-dev libsqlite3-dev + +On Fedora, you can install these using: + + sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel + +Generate configure: + + ./buildconf + +Configure your build. `--enable-debug` is recommended for development, see +`./configure --help` for a full list of options. + + # For development + ./configure --enable-debug + # For production + ./configure + +Build PHP. To speed up the build, specify the maximum number of jobs using `-j`: + + make -j4 + +The number of jobs should usually match the number of available cores, which +can be determined using `nproc`. + +## Testing PHP source code + +PHP ships with an extensive test suite, the command `make test` is used after +successful compilation of the sources to run this test suite. + +It is possible to run tests using multiple cores by setting `-jN` in +`TEST_PHP_ARGS`: + + make TEST_PHP_ARGS=-j4 test + +Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum +number of jobs should not exceed the number of cores available. + +The [qa.php.net](https://qa.php.net) site provides more detailed info about +testing and quality assurance. + +## Installing PHP built from source + +After a successful build (and test), PHP may be installed with: + + make install + +Depending on your permissions and prefix, `make install` may need super user +permissions. + +## PHP extensions + +Extensions provide additional functionality on top of PHP. PHP consists of many +essential bundled extensions. Additional extensions can be found in the PHP +Extension Community Library - [PECL](https://pecl.php.net). + +## Contributing + +The PHP source code is located in the Git repository at +[github.com/php/php-src](https://github.com/php/php-src). Contributions are most +welcome by forking the repository and sending a pull request. + +Discussions are done on GitHub, but depending on the topic can also be relayed +to the official PHP developer mailing list internals@lists.php.net. + +New features require an RFC and must be accepted by the developers. See +[Request for comments - RFC](https://wiki.php.net/rfc) and +[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information +on the process. + +Bug fixes don't require an RFC. If the bug has a GitHub issue, reference it in +the commit message using `GH-NNNNNN`. Use `#NNNNNN` for tickets in the old +[bugs.php.net](https://bugs.php.net) bug tracker. + + Fix GH-7815: php_uname doesn't recognise latest Windows versions + Fix #55371: get_magic_quotes_gpc() throws deprecation warning + +See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for details on how pull +requests are merged. + +### Guidelines for contributors + +See further documents in the repository for more information on how to +contribute: + +- [Contributing to PHP](/CONTRIBUTING.md) +- [PHP coding standards](/CODING_STANDARDS.md) +- [Mailing list rules](/docs/mailinglist-rules.md) +- [PHP release process](/docs/release-process.md) + +## Credits + +For the list of people who've put work into PHP, please see the +[PHP credits page](https://php.net/credits.php). diff --git a/apps/php7/versions/7.4.33/build/.env b/apps/php7/versions/7.4.33/build/.env new file mode 100644 index 00000000..7ddbcdca --- /dev/null +++ b/apps/php7/versions/7.4.33/build/.env @@ -0,0 +1,13 @@ +CONTAINER_PACKAGE_URL=mirrors.ustc.edu.cn + +PHP_VERSION=7.4.33 +PHP_PHP_CONF_FILE=./php/php.ini +PHP_FPM_CONF_FILE=./php/php-fpm.conf +PHP_LOG_DIR=./logs/php +PHP_EXTENSIONS= + +SOURCE_DIR=./www + +TZ=Asia/Shanghai +DATA_DIR=./data +IMAGE_NAME=1panel-php:7.4.33 \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/build/config.json b/apps/php7/versions/7.4.33/build/config.json new file mode 100644 index 00000000..5cdb9df9 --- /dev/null +++ b/apps/php7/versions/7.4.33/build/config.json @@ -0,0 +1,106 @@ +{ + "formFields": [ + { + "type": "select", + "multiple": true, + "labelZh": "扩展", + "labelEn": "Extensions", + "default": [], + "values": [ + { + "label": "opcache", + "value": "opcache" + }, + { + "label": "memcached", + "value": "memcached" + }, + { + "label": "memcache", + "value": "memcache" + }, + { + "label": "redis", + "value": "redis" + }, + { + "label": "mcrypt", + "value": "mcrypt" + }, + { + "label": "xdebug", + "value": "xdebug" + }, + { + "label": "imap", + "value": "imap" + }, + { + "label": "exif", + "value": "exif" + }, + { + "label": "intl", + "value": "intl" + }, + { + "label": "swoole", + "value": "swoole" + }, + { + "label": "yaf", + "value": "yaf" + }, + { + "label": "pgsql", + "value": "pgsql" + }, + { + "label": "pdo_pgsql", + "value": "pdo_pgsql" + }, + { + "label": "snmp", + "value": "snmp" + }, { + "label": "ldap", + "value": "ldap" + }, + { + "label": "pspell", + "value": "pspell" + }, + { + "label": "bz2", + "value": "bz2" + }, + { + "label": "sysvshm", + "value": "sysvshm" + }, + { + "label": "calendar", + "value": "calendar" + }, + { + "label": "gmp", + "value": "gmp" + }, + { + "label": "sysvmsg", + "value": "sysvmsg" + }, + { + "label": "igbinary", + "value": "igbinary" + }, + { + "label": "mysqli", + "value": "mysqli" + } + ], + "envKey": "PHP_EXTENSIONS", + "edit": true + } + ] +} \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/build/docker-compose.yml b/apps/php7/versions/7.4.33/build/docker-compose.yml new file mode 100644 index 00000000..75246ffb --- /dev/null +++ b/apps/php7/versions/7.4.33/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3" +services: + 1panel-php: + build: + context: ./php + args: + PHP_IMAGE: php:${PHP_VERSION}-fpm-alpine + CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} + PHP_EXTENSIONS: ${PHP_EXTENSIONS} + TZ: ${TZ} + image: ${IMAGE_NAME} + volumes: + - ${SOURCE_DIR}:/www/ + - ${PHP_PHP_CONF_FILE}:/usr/local/etc/php/php.ini + - ${PHP_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf + - ${PHP_LOG_DIR}:/var/log/php + - ${DATA_DIR}/composer:/tmp/composer + restart: always + cap_add: + - SYS_PTRACE + networks: + - default \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/build/php/Dockerfile b/apps/php7/versions/7.4.33/build/php/Dockerfile new file mode 100644 index 00000000..fd4e547d --- /dev/null +++ b/apps/php7/versions/7.4.33/build/php/Dockerfile @@ -0,0 +1,41 @@ +ARG PHP_IMAGE +FROM ${PHP_IMAGE} + +ARG TZ +ARG PHP_EXTENSIONS +ARG CONTAINER_PACKAGE_URL + + +RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi + + +COPY ./extensions /tmp/extensions +WORKDIR /tmp/extensions +RUN chmod +x install.sh \ + && sh install.sh + +ADD ./extensions/install-php-extensions /usr/local/bin/ + +RUN chmod uga+x /usr/local/bin/install-php-extensions + +RUN apk --no-cache add tzdata \ + && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ + && echo "$TZ" > /etc/timezone + + +# Fix: https://github.com/docker-library/php/issues/1121 +RUN apk add --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/v3.13/community/ gnu-libiconv=1.15-r3 +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php + + +# Install composer and change it's cache home +RUN chmod +x install-composer.sh \ + && sh install-composer.sh \ + && rm -rf /tmp/extensions +ENV COMPOSER_HOME=/tmp/composer + +# php image's www-data user uid & gid are 82, change them to 1000 (primary user) +RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data + + +WORKDIR /www diff --git a/apps/php7/versions/7.4.33/build/php/extensions/install-composer.sh b/apps/php7/versions/7.4.33/build/php/extensions/install-composer.sh new file mode 100644 index 00000000..34074732 --- /dev/null +++ b/apps/php7/versions/7.4.33/build/php/extensions/install-composer.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# 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, '7.2.5', '>');") + +if [ "$supportLatest" -eq "1" ]; then + curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ + && chmod +x /usr/bin/composer +else + curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ + && php /tmp/composer-setup.php --install-dir=/tmp \ + && mv /tmp/composer.phar /usr/bin/composer \ + && chmod +x /usr/bin/composer \ + && rm -rf /tmp/composer-setup.php +fi \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/build/php/extensions/install-php-extensions b/apps/php7/versions/7.4.33/build/php/extensions/install-php-extensions new file mode 100644 index 00000000..72a75d9f --- /dev/null +++ b/apps/php7/versions/7.4.33/build/php/extensions/install-php-extensions @@ -0,0 +1,4093 @@ +#!/bin/sh + +# This script wraps docker-php-ext-install, properly configuring the system. +# +# Copyright (c) Michele Locati, 2018-2023 +# +# Source: https://github.com/mlocati/docker-php-extension-installer +# +# License: MIT - see https://github.com/mlocati/docker-php-extension-installer/blob/master/LICENSE + +# Let's set a sane environment +set -o errexit +set -o nounset + +if test "${IPE_DEBUG:-}" = "1"; then + set -x +fi + +if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable >/dev/null || ! which docker-php-ext-install >/dev/null || ! which docker-php-source >/dev/null; then + printf 'The script %s is meant to be used with official Docker PHP Images - https://hub.docker.com/_/php\n' "$0" >&2 + exit 1 +fi + +IPE_VERSION=master + +StandWithUkraine() { + if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then + printf '\e[37;44m#StandWith\e[30;43mUkraine\e[0m\n' + else + printf '#StandWithUkraine\n' + fi +} + +if test "$IPE_VERSION" = master && test "${CI:-}" != true; then + cat <&2 + exit 1 + fi + DISTRO="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)" + DISTRO_VERSION_NUMBER="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)" + DISTRO_VERSION="$(printf '%s@%s' $DISTRO $DISTRO_VERSION_NUMBER)" + DISTRO_MAJMIN_VERSION="$(echo "$DISTRO_VERSION_NUMBER" | awk -F. '{print $1*100+$2}')" +} + +# Set: +# - PHP_MAJMIN_VERSION: Major-Minor version, format MMmm (example 800 for PHP 8.0.1) +# - PHP_MAJDOTMIN_VERSION: Major-Minor version, format M.m (example 8.0 for PHP 8.0.1) +# - PHP_MAJMINPAT_VERSION: Major-Minor-Patch version, format MMmmpp (example 80001 for PHP 8.0.1) variables containing integers value +# - PHP_MAJDOTMINDOTPAT_VERSION: Major-Minor-Patch version, format M.m.p (example 8.0.1 for PHP 8.0.1) +# - PHP_THREADSAFE: 1 if PHP is thread-safe (TS), 0 if not thread-safe (NTS) +# - PHP_DEBUGBUILD: 1 if PHP is debug build (configured with "--enable-debug"), 0 otherwise +# - PHP_BITS: 32 if PHP is compiled for 32-bit, 64 if 64-bit +# - PHP_EXTDIR: the absolute path where the PHP extensions reside +setPHPVersionVariables() { + PHP_MAJDOTMINDOTPAT_VERSION="$(php-config --version)" + PHP_MAJMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*100+$2}') + PHP_MAJDOTMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | cut -d. -f1-2) + PHP_MAJMINPAT_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*10000+$2*100+$3}') + PHP_THREADSAFE=$(php -n -r 'echo ZEND_THREAD_SAFE ? 1 : 0;') + PHP_DEBUGBUILD=$(php -n -r 'echo ZEND_DEBUG_BUILD ? 1 : 0;') + PHP_BITS=$(php -n -r 'echo PHP_INT_SIZE * 8;') + PHP_EXTDIR="$(php -d display_errors=stderr -r 'echo realpath(ini_get("extension_dir"));')" +} + +# Fix apt-get being very slow on Debian Jessie +# See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1332440 +fixMaxOpenFiles() { + fixMaxOpenFiles_cur=$(ulimit -n 2>/dev/null || echo 0) + if test "$fixMaxOpenFiles_cur" -gt 10000; then + ulimit -n 10000 + fi +} + +# Get the directory containing the compiled PHP extensions +# +# Output: +# The absolute path of the extensions dir +getPHPExtensionsDir() { + php -i | grep -E '^extension_dir' | head -n1 | tr -s '[:space:]*=>[:space:]*' '|' | cut -d'|' -f2 +} + +# Normalize the name of a PHP extension +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The normalized module name +normalizePHPModuleName() { + normalizePHPModuleName_name="$1" + case "$normalizePHPModuleName_name" in + *A* | *B* | *C* | *D* | *E* | *F* | *G* | *H* | *I* | *J* | *K* | *L* | *M* | *N* | *O* | *P* | *Q* | *R* | *S* | *T* | *U* | *V* | *W* | *X* | *Y* | *Z*) + normalizePHPModuleName_name="$(LC_CTYPE=C printf '%s' "$normalizePHPModuleName_name" | tr '[:upper:]' '[:lower:]')" + ;; + esac + case "$normalizePHPModuleName_name" in + datadog_trace) + normalizePHPModuleName_name=ddtrace + ;; + ioncube | ioncube\ loader) + normalizePHPModuleName_name='ioncube_loader' + ;; + pecl_http) + normalizePHPModuleName_name='http' + ;; + zend\ opcache) + normalizePHPModuleName_name='opcache' + ;; + libsodium) + if test $PHP_MAJMIN_VERSION -ge 700; then + normalizePHPModuleName_name='sodium' + fi + ;; + sodium) + if test $PHP_MAJMIN_VERSION -lt 700; then + normalizePHPModuleName_name='libsodium' + fi + ;; + *\ *) + printf '### WARNING Unrecognized module name: %s ###\n' "$1" >&2 + ;; + esac + printf '%s' "$normalizePHPModuleName_name" +} + +# Get the PECL name of PHP extension +# +# Arguments: +# $1: the name of the extension +# +# Output: +# The PECL name of the extension +getPeclModuleName() { + normalizePHPModuleName_name="$1" + case "$normalizePHPModuleName_name" in + ddtrace) + normalizePHPModuleName_name=datadog_trace + ;; + http) + normalizePHPModuleName_name=pecl_http + ;; + sodium) + normalizePHPModuleName_name=libsodium + ;; + esac + printf '%s' "$normalizePHPModuleName_name" +} + +# Parse a package.xml (or package2.xml) file and extract the module name and version +# +# Arguments: +# $1: the patho to the XML file +# +# Set these variables: +# - EXTRACTPACKAGEVERSIONFROMXML_NAME +# - EXTRACTPACKAGEVERSIONFROMXML_VERSION +# +# Output: +# Nothing +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +extractPackageVersionFromXML() { + if ! test -f "$1"; then + printf 'Unable to find the file\n%s\n' >&2 + return 1 + fi + extractPackageVersionFromXML_code="$( + cat <<'EOT' +$doc = new DOMDocument(); +if (!$doc->load($argv[1])) { + fwrite(STDERR, "Failed to load XML file\n"); + exit(1); +} +set_error_handler( + static function($errno, $errstr) { + fwrite(STDERR, trim((string) $errstr) . "\n"); + exit(1); + }, + -1 +); +$xpath = new DOMXpath($doc); +$xpath->registerNamespace('v20', 'http://pear.php.net/dtd/package-2.0'); +$xpath->registerNamespace('v21', 'http://pear.php.net/dtd/package-2.1'); +if ($xpath->query('/v20:package/v20:dependencies')->length === 1) { + $ns = 'v20:'; +} elseif ($xpath->query('/v21:package/v21:dependencies')->length === 1) { + $ns = 'v21:'; +} elseif ($xpath->query('/package')->length === 1) { + $ns = ''; +} else { + fwrite(STDERR, "Unsupported namespace of the XML of package version details\n"); +} +$nodes = $xpath->query("/{$ns}package/{$ns}name"); +$name = trim((string) $nodes[0]->nodeValue); +if ($ns === '') { + $nodes = $xpath->query("/{$ns}package/{$ns}version"); +} else { + $nodes = $xpath->query("/{$ns}package/{$ns}version/{$ns}release"); +} +$version = trim((string) $nodes[0]->nodeValue); +echo "EXTRACTPACKAGEVERSIONFROMXML_NAME='{$name}'\n"; +echo "EXTRACTPACKAGEVERSIONFROMXML_VERSION='{$version}'\n"; +exit(0); +EOT + )" + extractPackageVersionFromXML_vars="$(php -n -d display_errors=stderr -r "$extractPackageVersionFromXML_code" "$1")" + if test -z "$extractPackageVersionFromXML_vars"; then + return 1 + fi + eval "$extractPackageVersionFromXML_vars" + return 0 +} + +# Parse a module name (and optionally version) as received via command arguments, extracting the version and normalizing it +# Examples: +# xdebug-2.9.8 +# xdebug-^2 +# xdebug-^2.9 +# +# Arguments: +# $1: the name of the module to be normalized +# +# Set these variables: +# - PROCESSED_PHP_MODULE_ARGUMENT +# +# Optionally set these variables: +# - PHP_WANTEDMODULEVERSION_<...> (where <...> is the normalized module name) +# - PHP_MODULESOURCECODEPATH_<...> (where <...> is the normalized module name) +# +# Output: +# Nothing +processPHPModuleArgument() { + processPHPModuleArgument_arg="$1" + # Convert GitHub short form to long url, + # for example: from + # php-memcached-dev/php-memcached@8f106564e6bb005ca6100b12ccc89000daafa9d8 + # to + # https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/8f106564e6bb005ca6100b12ccc89000daafa9d8 + processPHPModuleArgument_arg="$(printf '%s' "$processPHPModuleArgument_arg" | sed -E 's/^([a-zA-Z0-9_.\-]+\/[a-zA-Z0-9_.\-]+)@(.+$)/https:\/\/codeload.github.com\/\1\/tar.gz\/\2/')" + # Let's check if $processPHPModuleArgument_arg is an URL + if printf '%s' "$processPHPModuleArgument_arg" | grep -Eq '^https?://[^ ]+/[^ ]+$'; then + printf 'Downloading source from %s\n' "$processPHPModuleArgument_arg" + processPHPModuleArgument_arg="$(getPackageSource "$processPHPModuleArgument_arg")" + fi + # Let's check if $processPHPModuleArgument_arg the absolute path of an existing directory + if test "$processPHPModuleArgument_arg" != "${processPHPModuleArgument_arg#/}" && test -d "$processPHPModuleArgument_arg"; then + if test -f "$processPHPModuleArgument_arg/package2.xml"; then + printf 'Checking package2.xml of directory %s... ' "$processPHPModuleArgument_arg" + if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package2.xml"; then + return 1 + fi + elif test -f "$processPHPModuleArgument_arg/package.xml"; then + printf 'Checking package.xml of directory %s... ' "$processPHPModuleArgument_arg" + if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package.xml"; then + return 1 + fi + else + printf 'Unable to find the package.xml file in the directory\n%s\n' "$processPHPModuleArgument_arg" + return 1 + fi + printf 'good (name: %s, version: %s)\n' "$EXTRACTPACKAGEVERSIONFROMXML_NAME" "$EXTRACTPACKAGEVERSIONFROMXML_VERSION" + PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$EXTRACTPACKAGEVERSIONFROMXML_NAME")" + processPHPModuleArgument_version="$EXTRACTPACKAGEVERSIONFROMXML_VERSION" + if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval PHP_MODULESOURCECODEPATH_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_arg" + else + printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2 + exit 1 + fi + else + PROCESSED_PHP_MODULE_ARGUMENT="${processPHPModuleArgument_arg%%-*}" + if test -n "$PROCESSED_PHP_MODULE_ARGUMENT" && test "$PROCESSED_PHP_MODULE_ARGUMENT" != "$processPHPModuleArgument_arg"; then + processPHPModuleArgument_version="${processPHPModuleArgument_arg#*-}" + else + processPHPModuleArgument_version='' + fi + PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$PROCESSED_PHP_MODULE_ARGUMENT")" + fi + if test -n "$processPHPModuleArgument_version"; then + if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval PHP_WANTEDMODULEVERSION_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_version" + elif printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^@[a-zA-Z0-9_]+$'; then + eval PHP_WANTEDMODULEVERSION__${PROCESSED_PHP_MODULE_ARGUMENT#@}="$processPHPModuleArgument_version" + else + printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2 + fi + fi +} + +# Get the wanted PHP module version, as specified in the command line arguments. +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The wanted version (if any) +getWantedPHPModuleVersion() { + if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_WANTEDMODULEVERSION_$1:-}" + elif printf '%s' "$1" | grep -Eq '^@[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_WANTEDMODULEVERSION__${1#@}:-}" + fi +} + +# Get source code path of a PHP module version, as specified in the command line arguments. +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The wanted version (if any) +getModuleSourceCodePath() { + if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_MODULESOURCECODEPATH_$1:-}" + fi +} + +# Get the wanted PHP module version, resolving it if it starts with '^' +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The version to be used +resolveWantedPHPModuleVersion() { + resolveWantedPHPModuleVersion_raw="$(getWantedPHPModuleVersion "$1")" + resolveWantedPHPModuleVersion_afterCaret="${resolveWantedPHPModuleVersion_raw#^}" + if test "$resolveWantedPHPModuleVersion_raw" = "$resolveWantedPHPModuleVersion_afterCaret"; then + printf '%s' "$resolveWantedPHPModuleVersion_raw" + return + fi + resolveWantedPHPModuleVersion_xml="$(curl -sSLf "http://pecl.php.net/rest/r/$1/allreleases.xml")" + resolveWantedPHPModuleVersion_versions="$(printf '%s' "$resolveWantedPHPModuleVersion_xml" | tr -s ' \t\r\n' ' ' | sed -r 's# *<#\n<#g' | grep '' | sed 's###g' | sed 's# ##g')" + resetIFS + for resolveWantedPHPModuleVersion_version in $resolveWantedPHPModuleVersion_versions; do + resolveWantedPHPModuleVersion_suffix="${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret}" + if test "$resolveWantedPHPModuleVersion_version" != "${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret.}"; then + # Example: looking for 1.0, found 1.0.1 + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + fi + done + for resolveWantedPHPModuleVersion_version in $resolveWantedPHPModuleVersion_versions; do + resolveWantedPHPModuleVersion_suffix="${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret}" + if test "$resolveWantedPHPModuleVersion_version" = "$resolveWantedPHPModuleVersion_suffix"; then + continue + fi + if test -z "$resolveWantedPHPModuleVersion_suffix"; then + # Example: looking for 1.0, found exactly it + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + fi + case "$resolveWantedPHPModuleVersion_suffix" in + [0-9]) + # Example: looking for 1.1, but this is 1.10 + ;; + *) + # Example: looking for 1.1, this is 1.1rc1 + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + ;; + esac + done + printf 'Unable to find a version of "%s" compatible with "%s"\nAvailable versions are:\n%s\n' "$1" "$resolveWantedPHPModuleVersion_raw" "$resolveWantedPHPModuleVersion_versions" >&2 + exit 1 +} + +# Get the actual version of a PECL pmodule, resolving 'latest', 'stable', 'beta', 'alpha', 'devel'. +# +# Arguments: +# $1: the module name as known on the PECL archive +# $2: the version to be resolved +# Output: +# $2 itself if $1 is not 'latest', 'stable', 'beta', 'alpha', or 'devel', the actual version otherwise +resolvePeclStabilityVersion() { + case "$2" in + latest | stable | beta | alpha | devel) ;; + *) + printf '%s' "$2" + return + ;; + esac + peclStabilityFlagToVersion_url="http://pecl.php.net/rest/r/$1/$2.txt" + if ! peclStabilityFlagToVersion_result="$(curl -sSLf "$peclStabilityFlagToVersion_url")"; then + peclStabilityFlagToVersion_result='' + fi + if test -z "$peclStabilityFlagToVersion_result"; then + printf 'Failed to resolve the PECL package version "%s" of %s from %s\n' "$2" "$1" "$peclStabilityFlagToVersion_url" >&2 + exit 1 + fi + printf '%s' "$peclStabilityFlagToVersion_result" +} + +# Set these variables: +# - PHP_PREINSTALLED_MODULES the normalized list of PHP modules installed before running this script +setPHPPreinstalledModules() { + PHP_PREINSTALLED_MODULES='' + IFS=' +' + for getPHPInstalledModules_module in $(php -m); do + getPHPInstalledModules_moduleNormalized='' + case "$getPHPInstalledModules_module" in + \[PHP\ Modules\]) ;; + \[Zend\ Modules\]) + break + ;; + *) + getPHPInstalledModules_moduleNormalized="$(normalizePHPModuleName "$getPHPInstalledModules_module")" + if ! stringInList "$getPHPInstalledModules_moduleNormalized" "$PHP_PREINSTALLED_MODULES"; then + PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES $getPHPInstalledModules_moduleNormalized" + fi + ;; + esac + done + if command -v composer >/dev/null; then + PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES @composer" + fi + resetIFS + PHP_PREINSTALLED_MODULES="${PHP_PREINSTALLED_MODULES# }" +} + +# Get the handles of the modules to be installed +# +# Arguments: +# $@: all module handles +# +# Set: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +processCommandArguments() { + processCommandArguments_endArgs=0 + PHP_MODULES_TO_INSTALL='' + # Support deprecated flag IPE_FIX_CACERTS + case "${IPE_FIX_CACERTS:-}" in + 1 | y* | Y*) + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL @fix_letsencrypt" + ;; + esac + while :; do + if test $# -lt 1; then + break + fi + processCommandArguments_skip=0 + if test $processCommandArguments_endArgs -eq 0; then + case "$1" in + --cleanup) + printf '### WARNING the %s option is deprecated (we always cleanup everything) ###\n' "$1" >&2 + processCommandArguments_skip=1 + ;; + --) + processCommandArguments_skip=1 + processCommandArguments_endArgs=1 + ;; + -*) + printf 'Unrecognized option: %s\n' "$1" >&2 + exit 1 + ;; + esac + fi + if test $processCommandArguments_skip -eq 0; then + processPHPModuleArgument "$1" + processCommandArguments_name="$PROCESSED_PHP_MODULE_ARGUMENT" + if stringInList "$processCommandArguments_name" "$PHP_MODULES_TO_INSTALL"; then + printf '### WARNING Duplicated module name specified: %s ###\n' "$processCommandArguments_name" >&2 + elif stringInList "$processCommandArguments_name" "$PHP_PREINSTALLED_MODULES"; then + printf '### WARNING Module already installed: %s ###\n' "$processCommandArguments_name" >&2 + else + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $processCommandArguments_name" + fi + fi + shift + done + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }" +} + +# Add a module that's required by another module +# +# Arguments: +# $1: module that requires another module +# $2: the required module +# +# Update: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +checkRequiredModule() { + if ! stringInList "$1" "$PHP_MODULES_TO_INSTALL"; then + return + fi + if stringInList "$2" "$PHP_PREINSTALLED_MODULES"; then + return + fi + PHP_MODULES_TO_INSTALL="$(removeStringFromList "$1" "$PHP_MODULES_TO_INSTALL")" + if ! stringInList "$2" "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $2" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }" + fi + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $1" +} + +# Sort the modules to be installed, in order to fix dependencies +# +# Update: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +sortModulesToInstall() { + # apcu_bc requires apcu + checkRequiredModule 'apcu_bc' 'apcu' + # http requires propro (for PHP < 8) and raphf + if test $PHP_MAJMIN_VERSION -le 704; then + checkRequiredModule 'http' 'propro' + fi + checkRequiredModule 'http' 'raphf' + # event requires sockets (for PHP <= 5.6) + if test $PHP_MAJMIN_VERSION -le 506; then + checkRequiredModule event sockets + fi + # relay requires msgpack + checkRequiredModule relay msgpack + # relay requires igbinary + checkRequiredModule relay igbinary + # Some module installation may use sockets if available: move it before other modules + if stringInList 'sockets' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'sockets' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="sockets $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use igbinary if available: move it before other modules + if stringInList 'igbinary' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'igbinary' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="igbinary $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use msgpack if available: move it before other modules + if stringInList 'msgpack' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'msgpack' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="msgpack $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use socket if available: move it before other modules + if stringInList 'socket' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'socket' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="socket $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use apcu if available: move it before other modules + if stringInList 'apcu' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'apcu' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="apcu $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # In any case, first of all, we need to install composer + if stringInList '@composer' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList '@composer' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="@composer $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi +} + +# Expand the IPE_ASPELL_LANGUAGES environment variable into apk/apt package names +expandASpellDictionaries() { + expandASpellDictionaries_languages="${IPE_ASPELL_LANGUAGES:-en}" + expandASpellDictionaries_result='' + resetIFS + for expandASpellDictionaries_language in $expandASpellDictionaries_languages; do + expandASpellDictionaries_result="$expandASpellDictionaries_result aspell-$expandASpellDictionaries_language" + done + printf '%s' "${expandASpellDictionaries_result# }" +} + +# Get the required APT/APK packages for a specific PHP version and for the list of module handles +# +# Arguments: +# $@: the PHP module handles +# +# Set: +# PACKAGES_PERSISTENT_NEW the list of packages required at runtume that must be installed +# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed +# PACKAGES_VOLATILE the list of packages required at compile time that must be installed +# PACKAGES_PREVIOUS the list of packages (with their version) that are installed right now (calculated only on Debian and only if PACKAGES_PERSISTENT_NEW or PACKAGES_VOLATILE are not empty) +buildRequiredPackageLists() { + buildRequiredPackageLists_persistent='' + buildRequiredPackageLists_volatile='' + case "$DISTRO" in + alpine) + apk update + ;; + debian) + invokeAptGetUpdate + ;; + esac + case "$DISTRO_VERSION" in + alpine@*) + if test $# -gt 1 || test "${1:-}" != '@composer'; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS" + fi + if test -z "$(apk info 2>/dev/null | grep -E ^libssl)"; then + buildRequiredPackageLists_libssl='libssl1.0' + elif test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libtls')" && test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libssl')" && test -z "$(apk info 2>/dev/null | grep -E '^libretls-')"; then + buildRequiredPackageLists_libssl=$(apk search -q libressl*-libtls) + else + buildRequiredPackageLists_libssl='' + fi + if test $DISTRO_MAJMIN_VERSION -le 313; then + buildRequiredPackageLists_libssldev='libressl-dev' + else + buildRequiredPackageLists_libssldev='libretls-dev' + fi + buildRequiredPackageLists_icuPersistent='' + if test $DISTRO_MAJMIN_VERSION -ge 316; then + case "${IPE_ICU_EN_ONLY:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_icuPersistent='icu-data-full' + ;; + esac + fi + ;; + debian@9) + buildRequiredPackageLists_libssldev='libssl1.0-dev' + ;; + debian@*) + buildRequiredPackageLists_libssldev='^libssl([0-9]+(\.[0-9]+)*)?-dev$' + ;; + esac + if test $USE_PICKLE -gt 1; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git" + fi + while :; do + if test $# -lt 1; then + break + fi + case "$1@$DISTRO" in + @composer@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unzip" + ;; + amqp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent rabbitmq-c" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile rabbitmq-c-dev" + ;; + amqp@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librabbitmq[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librabbitmq-dev libssh-dev" + ;; + bz2@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbz2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile bzip2-dev" + ;; + bz2@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libbz2-dev" + ;; + cassandra@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent cassandra-cpp-driver gmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cassandra-cpp-driver-dev gmp-dev" + ;; + cmark@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + ;; + cmark@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + ;; + ddtrace@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev" + ;; + ddtrace@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent curl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-openssl-dev" + ;; + dba@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent db" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile db-dev" + ;; + dba@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libdb5\.3-dev$" + if test $PHP_MAJMIN_VERSION -le 505; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile patch" + fi + ;; + decimal@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev" + ;; + enchant@alpine) + if test $DISTRO_MAJMIN_VERSION -ge 312; then + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" + else + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + fi + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant-dev" + fi + ;; + enchant@debian) + if test $DISTRO_VERSION_NUMBER -ge 11; then + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" + else + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-en libhunspell-1.7-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libglib2.0-dev libaspell-dev libhunspell-dev" + fi + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-dev" + fi + ;; + event@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev" + ;; + event@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libevent[0-9\.\-]*$ ^libevent-openssl[0-9\.\-]*$ ^libevent-extra[0-9\.\-]*$ ^libevent-pthreads[0-9\.\-]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev" + ;; + ffi@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libffi" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev" + ;; + ffi@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev" + ;; + gd@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetype libjpeg-turbo libpng libxpm" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetype-dev libjpeg-turbo-dev libpng-dev libxpm-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvpx" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + if test $DISTRO_MAJMIN_VERSION -ge 315; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libavif aom-libs libdav1d" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev aom-dev dav1d-dev" + elif isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + else + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson" + ;; + esac + fi + fi + fi + ;; + gd@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libvpx[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libwebp[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + if ! isLibaomInstalled || ! isLibdav1dInstalled || ! isLibyuvInstalled || ! isLibavifInstalled; then + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson" + ;; + esac + fi + fi + fi + ;; + gearman@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ libuuid" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile boost-dev gperf libmemcached-dev libevent-dev util-linux-dev" + ;; + gearman@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgearman[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgearman-dev" + ;; + geoip@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geoip" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geoip-dev" + ;; + geoip@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeoip1[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeoip-dev" + ;; + geos@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geos-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geos" + ;; + geos@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeos-c1(v[0-9]*)?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeos-dev" + ;; + gettext@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libintl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gettext-dev" + ;; + gmagick@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent graphicsmagick libgomp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile graphicsmagick-dev libtool" + ;; + gmagick@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgraphicsmagick(-q16-)?[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgraphicsmagick1-dev" + ;; + gmp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gmp-dev" + ;; + gmp@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgmp-dev" + ;; + gnupg@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gpgme" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gpgme-dev" + ;; + gnupg@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgpgme[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libgpgme[0-9]*-dev$" + ;; + grpc@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev linux-headers" + ;; + grpc@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + http@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev curl-dev libevent-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libidn" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libidn-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libidn" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev libidn-dev" + fi + ;; + http@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls ^libevent[0-9\.\-]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libgnutls28-dev libcurl4-gnutls-dev libevent-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libidn1[0-9+]-dev$" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$ ^libidn2-[0-9+]$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$" + fi + ;; + imagick@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent imagemagick libgomp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile imagemagick-dev" + ;; + imagick@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmagickwand-6.q16-[0-9]+$ ^libmagickcore-6.q16-[0-9]+-extra$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmagickwand-dev" + ;; + imap@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-client $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile krb5-dev imap-dev $buildRequiredPackageLists_libssldev" + ;; + imap@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-client2007e" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libkrb5-dev" + case "$DISTRO_VERSION" in + debian@9) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev comerr-dev krb5-multidev libc-client2007e libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-8 libpam0g-dev libssl-doc mlock" + ;; + *) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-client-dev" + ;; + esac + ;; + interbase@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + ;; + interbase@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util" + ;; + intl@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev" + ;; + intl@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev" + ;; + ion@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake git" + ;; + ion@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake git" + ;; + ldap@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libldap" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile openldap-dev" + ;; + ldap@debian) + if test $DISTRO_VERSION_NUMBER -ge 9; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libldap-common" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libldap2-dev" + ;; + luasandbox@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lua5.1-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lua5.1-dev" + ;; + luasandbox@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblua5.1-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblua5.1-0-dev" + ;; + lz4@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lz4-dev" + ;; + lz4@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblz4-1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblz4-dev" + ;; + maxminddb@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmaxminddb" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmaxminddb-dev" + ;; + maxminddb@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmaxminddb[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmaxminddb-dev" + ;; + memprof@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent judy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile judy-dev bsd-compat-headers" + ;; + memprof@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libjudydebian1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libjudy-dev" + ;; + mcrypt@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmcrypt" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmcrypt-dev" + ;; + mcrypt@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmcrypt4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmcrypt-dev" + ;; + memcache@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + memcache@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + memcached@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmemcached-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmemcached-dev zlib-dev" + ;; + memcached@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmemcachedutil2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmemcached-dev zlib1g-dev" + ;; + mongo@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsasl $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev cyrus-sasl-dev" + ;; + mongo@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libsasl2-dev" + ;; + mongodb@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libsasl $buildRequiredPackageLists_libssl snappy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev cyrus-sasl-dev snappy-dev $buildRequiredPackageLists_libssldev zlib-dev" + ;; + mongodb@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsnappy[0-9]+(v[0-9]+)?$ ^libicu[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev libsasl2-dev libsnappy-dev $buildRequiredPackageLists_libssldev zlib1g-dev" + ;; + mosquitto@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent mosquitto-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile mosquitto-dev" + ;; + mosquitto@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmosquitto1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmosquitto-dev" + ;; + mssql@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + mssql@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsybdb5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + oauth@alpine) + if test $PHP_MAJMIN_VERSION -ge 700; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev" + fi + ;; + oauth@debian) + if test $PHP_MAJMIN_VERSION -ge 700; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev" + fi + ;; + oci8@alpine | pdo_oci@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libaio libc6-compat libnsl" + if test $DISTRO_MAJMIN_VERSION -le 307; then + # The unzip tool of Alpine 3.7 can't extract symlinks from ZIP archives: let's use bsdtar instead + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libarchive-tools" + fi + ;; + oci8@debian | pdo_oci@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libaio[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unzip" + ;; + odbc@alpine | pdo_odbc@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + odbc@debian | pdo_odbc@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libodbc1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + openswoole@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + ;; + openswoole@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + ;; + parle@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + pdo_dblib@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + pdo_dblib@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsybdb5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + pdo_firebird@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + ;; + pdo_firebird@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util" + ;; + pgsql@alpine | pdo_pgsql@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile postgresql-dev" + ;; + pgsql@debian | pdo_pgsql@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpq-dev" + ;; + php_trie@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + pspell@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-libs $(expandASpellDictionaries)" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile aspell-dev" + ;; + pspell@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libaspell15 $(expandASpellDictionaries)" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpspell-dev" + ;; + rdkafka@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librdkafka" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev" + ;; + rdkafka@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librdkafka\+*[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev" + ;; + recode@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent recode" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile recode-dev" + ;; + recode@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librecode0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librecode-dev" + ;; + redis@alpine) + if test $PHP_MAJMIN_VERSION -ge 700; then + case "$DISTRO_VERSION" in + alpine@3.7) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd" + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + ;; + esac + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zstd-dev" + fi + ;; + redis@debian) + if test $PHP_MAJMIN_VERSION -ge 700; then + case "$DISTRO_VERSION" in + debian@8) + ## There's no APT package for libzstd + ;; + debian@9) + ## libzstd is too old (available: 1.1.2, required: 1.3.0+) + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + ;; + esac + fi + ;; + relay@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs zstd-libs" + if test $DISTRO_MAJMIN_VERSION -ge 317; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.1" + fi + ;; + simdjson@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + smbclient@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsmbclient" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile samba-dev" + ;; + smbclient@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsmbclient" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsmbclient-dev" + ;; + snappy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent snappy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile snappy-dev" + ;; + snappy@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsnappy1(v[0-9]+)?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsnappy-dev" + ;; + snmp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent net-snmp-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile net-snmp-dev" + ;; + snmp@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent snmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsnmp-dev" + ;; + snuffleupagus@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent pcre" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev" + ;; + snuffleupagus@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev" + ;; + soap@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + soap@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + sockets@alpine) + if test $PHP_MAJMIN_VERSION -ge 802; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + fi + ;; + sodium@alpine | libsodium@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsodium" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev" + ;; + sodium@debian | libsodium@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsodium[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev" + ;; + solr@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev libxml2-dev" + ;; + solr@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-gnutls-dev libxml2-dev" + ;; + spx@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + spx@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + sqlsrv@alpine | pdo_sqlsrv@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + sqlsrv@debian | pdo_sqlsrv@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + if ! isMicrosoftSqlServerODBCInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gnupg apt-transport-https" + fi + ;; + ssh2@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssh2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-dev" + ;; + ssh2@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-1-dev" + ;; + stomp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev" + ;; + stomp@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev" + ;; + swoole@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + fi + ;; + swoole@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + fi + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + fi + ;; + sybase_ct@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + sybase_ct@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libct4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + tdlib@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git cmake gperf zlib-dev $buildRequiredPackageLists_libssldev linux-headers readline-dev" + ;; + tdlib@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git cmake gperf zlib1g-dev $buildRequiredPackageLists_libssldev" + ;; + tensor@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lapack libexecinfo openblas" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lapack-dev libexecinfo-dev openblas-dev" + if test $DISTRO_MAJMIN_VERSION -le 310; then + if ! stringInList --force-overwrite "$IPE_APK_FLAGS"; then + IPE_APK_FLAGS="$IPE_APK_FLAGS --force-overwrite" + fi + fi + ;; + tensor@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblapacke libopenblas-base" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblapack-dev libopenblas-dev liblapacke-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gfortran-10" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgfortran-10-dev" + elif test $DISTRO_VERSION_NUMBER -ge 10; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gfortran-8" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgfortran-8-dev" + fi + ;; + tidy@alpine) + if test $DISTRO_MAJMIN_VERSION -ge 315; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent tidyhtml" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent tidyhtml-libs" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile tidyhtml-dev" + ;; + tidy@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libtidy-?[0-9][0-9.\-]*(deb[0-9])?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libtidy-dev" + ;; + uuid@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libuuid" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile util-linux-dev" + ;; + uuid@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile uuid-dev" + ;; + vips@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent vips" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile vips-dev" + ;; + vips@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvips" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvips-dev" + ;; + wddx@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + wddx@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xdebug@alpine) + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + fi + ;; + xlswriter@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + xlswriter@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + xmldiff@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmldiff@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmlrpc@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmlrpc@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xsl@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" + ;; + xsl@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libxslt1\.1$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev" + ;; + yaml@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent yaml" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile yaml-dev" + ;; + yaml@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libyaml-0-2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libyaml-dev" + ;; + yar@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev" + ;; + yar@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-gnutls-dev" + ;; + zip@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libzip-dev $buildRequiredPackageLists_libssldev zlib-dev" + ;; + zip@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzip[0-9]$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev $buildRequiredPackageLists_libssldev libzip-dev libbz2-dev zlib1g-dev" + case "$DISTRO_VERSION" in + debian@8) + # Debian Jessie doesn't seem to provide libmbedtls + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmbedtls[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmbedtls-dev" + ;; + esac + ;; + zmq@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zeromq-dev" + ;; + zmq@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzmq3-dev" + ;; + zookeeper@alpine) + if ! test -f /usr/local/include/zookeeper/zookeeper.h; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile maven automake libtool openjdk8" + fi + ;; + zookeeper@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzookeeper-mt2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzookeeper-mt-dev" + ;; + esac + shift + done + PACKAGES_PERSISTENT_NEW='' + PACKAGES_PERSISTENT_PRE='' + PACKAGES_VOLATILE='' + PACKAGES_PREVIOUS='' + if test -z "$buildRequiredPackageLists_persistent$buildRequiredPackageLists_volatile"; then + return + fi + if test -n "$buildRequiredPackageLists_persistent"; then + PACKAGES_PERSISTENT_NEW="$(expandPackagesToBeInstalled $buildRequiredPackageLists_persistent)" + if test -s "$IPE_ERRFLAG_FILE"; then + exit 1 + fi + resetIFS + for buildRequiredPackageLists_package in $buildRequiredPackageLists_persistent; do + buildRequiredPackageLists_package="$(expandInstalledSystemPackageName "$buildRequiredPackageLists_package")" + if test -n "$buildRequiredPackageLists_package"; then + PACKAGES_PERSISTENT_PRE="$PACKAGES_PERSISTENT_PRE $buildRequiredPackageLists_package" + fi + done + PACKAGES_PERSISTENT_PRE="${PACKAGES_PERSISTENT_PRE# }" + fi + if test -n "$buildRequiredPackageLists_volatile"; then + buildRequiredPackageLists_packages="$(expandPackagesToBeInstalled $buildRequiredPackageLists_volatile)" + if test -s "$IPE_ERRFLAG_FILE"; then + exit 1 + fi + resetIFS + for buildRequiredPackageLists_package in $buildRequiredPackageLists_packages; do + if ! stringInList "$buildRequiredPackageLists_package" "$PACKAGES_PERSISTENT_NEW"; then + if test "$buildRequiredPackageLists_package" != icu-data-en || ! stringInList icu-data-full "$PACKAGES_PERSISTENT_NEW"; then + PACKAGES_VOLATILE="$PACKAGES_VOLATILE $buildRequiredPackageLists_package" + fi + fi + done + PACKAGES_VOLATILE="${PACKAGES_VOLATILE# }" + fi + if test -n "$PACKAGES_PERSISTENT_NEW$PACKAGES_VOLATILE"; then + case "$DISTRO" in + debian) + PACKAGES_PREVIOUS="$(dpkg --get-selections | grep -E '\sinstall$' | awk '{ print $1 }')" + ;; + esac + fi +} + +# Get the full list of APT/APK packages that will be installed, given the required packages +# +# Arguments: +# $1: the list of required APT/APK packages +# +# Output: +# Space-separated list of every APT/APK packages that will be installed +expandPackagesToBeInstalled() { + expandPackagesToBeInstalled_result='' + case "$DISTRO" in + alpine) + expandPackagesToBeInstalled_log="$(apk add --simulate $@ 2>&1 || printf '\nERROR: apk failed\n')" + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^ERROR:')"; then + printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 + printf '%s ' "$@" >&2 + printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2 + echo 'y' >"$IPE_ERRFLAG_FILE" + exit 1 + fi + IFS=' +' + for expandPackagesToBeInstalled_line in $expandPackagesToBeInstalled_log; do + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_line" | grep -E '^\([0-9]*/[0-9]*) Installing ')"; then + expandPackagesToBeInstalled_result="$expandPackagesToBeInstalled_result $(printf '%s' "$expandPackagesToBeInstalled_line" | cut -d ' ' -f 3)" + fi + done + resetIFS + ;; + debian) + expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then + printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 + printf '%s ' "$@" >&2 + printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2 + echo 'y' >"$IPE_ERRFLAG_FILE" + exit 1 + fi + expandPackagesToBeInstalled_inNewPackages=0 + IFS=' +' + for expandPackagesToBeInstalled_line in $expandPackagesToBeInstalled_log; do + if test $expandPackagesToBeInstalled_inNewPackages -eq 0; then + if test "$expandPackagesToBeInstalled_line" = 'The following NEW packages will be installed:'; then + expandPackagesToBeInstalled_inNewPackages=1 + fi + elif test "$expandPackagesToBeInstalled_line" = "${expandPackagesToBeInstalled_line# }"; then + break + else + resetIFS + for expandPackagesToBeInstalled_newPackage in $expandPackagesToBeInstalled_line; do + expandPackagesToBeInstalled_result="$expandPackagesToBeInstalled_result $expandPackagesToBeInstalled_newPackage" + done + IFS=' +' + fi + done + resetIFS + ;; + esac + printf '%s' "${expandPackagesToBeInstalled_result# }" +} + +# Check if a system package is installed; if so we prints its name. +# +# Arguments: +# $1: the name of the package to be checked (regular expressions accepted: they must start with a ^) +expandInstalledSystemPackageName() { + if test "$1" = "${1#^}"; then + expandInstalledSystemPackageName_grepflags='-Fx' + else + expandInstalledSystemPackageName_grepflags='-E' + fi + case "$DISTRO" in + alpine) + apk info | grep $expandInstalledSystemPackageName_grepflags -- "$1" || test $? -eq 1 + ;; + debian) + dpkg --get-selections | grep -E '\sinstall$' | awk '{ print $1 }' | cut -d: -f1 | grep $expandInstalledSystemPackageName_grepflags -- "$1" || test $? -eq 1 + ;; + esac +} + +# Retrieve the number of available cores (alternative to nproc if not available) +# +# Output: +# The number of processor cores available +getProcessorCount() { + if command -v nproc >/dev/null 2>&1; then + nproc + else + getProcessorCount_tmp=$(cat /proc/cpuinfo | grep -E '^processor\s*:\s*\d+$' | wc -l) + if test $getProcessorCount_tmp -ge 1; then + echo $getProcessorCount_tmp + else + echo 1 + fi + fi +} + +# Set these variables: +# - TARGET_TRIPLET the build target tripled (eg 'x86_64-linux-gnu', 'x86_64-alpine-linux-musl') +setTargetTriplet() { + TARGET_TRIPLET="$(gcc -print-multiarch 2>/dev/null || true)" + if test -z "$TARGET_TRIPLET"; then + TARGET_TRIPLET="$(gcc -dumpmachine)" + fi +} + +# Retrieve the number of processors to be used when compiling an extension +# +# Arguments: +# $1: the handle of the PHP extension to be compiled +# Output: +# The number of processors to be used +getCompilationProcessorCount() { + case "$1" in + '') + # The above extensions don't support parallel compilation + echo 1 + ;; + *) + # All the other extensions support parallel compilation + getProcessorCount + ;; + esac +} + +# Get the full path of a PHP extension given its name. +# +# Arguments: +# $1: the name of the PHP extension +# +# Output: +# The absolute path of the PHP extension file (or nothing if the file can't be found) +getModuleFullPath() { + case "$1" in + apcu_bc) + getModuleFullPath_path="$PHP_EXTDIR/apc.so" + ;; + *) + getModuleFullPath_path="$PHP_EXTDIR/$1.so" + ;; + esac + if ! test -f "$getModuleFullPath_path"; then + printf 'Unable to find the file of the PHP extension "%s"\n' "$1" >&2 + exit 1 + fi + printf '%s' "$getModuleFullPath_path" +} + +# Post-process a PHP module just compiled and installed in the PHP extension directory +# +# Arguments: +# $1: the name of the PHP extension +# +# Return: +# 0 (true): if suceeded +# non-zero (false): in case of errors +postProcessModule() { + postProcessModule_file="$(getModuleFullPath "$1")" + if test $PHP_DEBUGBUILD -ne 1; then + printf 'Removing symbols from %s... ' "$postProcessModule_file" + postProcessModule_preSize="$(stat -c %s "$postProcessModule_file")" + strip --strip-all "$postProcessModule_file" + postProcessModule_postSize="$(stat -c %s "$postProcessModule_file")" + printf 'done (%s bytes saved).\n' "$((postProcessModule_preSize - postProcessModule_postSize))" + fi + return $? +} + +# Get the type of the php.ini entry to be used for a PHP extension +# +# Arguments: +# $1: the name of the PHP extension +# +# Output: +# zend_extension or extension +getModuleIniEntryType() { + case "$1" in + ioncube_loader | sourceguardian) + # On PHP 5.5, docker-php-ext-enable fails to detect that ionCube Loader and sourceguardian are Zend extensions + if test $PHP_MAJMIN_VERSION -le 505; then + printf 'zend_extension' + return 0 + fi + ;; + esac + getModuleIniEntryType_file="$(getModuleFullPath "$1")" + if readelf --wide --syms "$getModuleIniEntryType_file" | grep -Eq ' zend_extension_entry$'; then + printf 'zend_extension' + else + printf 'extension' + fi +} + +# Create the contents of a PHP ini file that enables an extension +# +# Arguments: +# $1: the name of the PHP extension +# $2: additional php.ini configuration (optional) +# +# Output: +# The contents of the ini file +buildPhpExtensionIniContent() { + buildPhpExtensionIniContent_type="$(getModuleIniEntryType "$1")" + buildPhpExtensionIniContent_soFile="$(getModuleFullPath "$1")" + buildPhpExtensionIniContent_result="$(printf '%s=%s' "$buildPhpExtensionIniContent_type" "${buildPhpExtensionIniContent_soFile##$PHP_EXTDIR/}")" + if test -n "${2:-}"; then + buildPhpExtensionIniContent_result="$(printf '%s\n%s' "$buildPhpExtensionIniContent_result" "$2")" + fi + printf '%s' "$buildPhpExtensionIniContent_result" +} + +# Check that a PHP module actually works (better to run this check before enabling the extension) +# +# Arguments: +# $1: the name of the PHP extension +# $2: base name (without path and extension) of additional php.ini configuration (optional) +# $3: additional php.ini configuration (optional) +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +checkModuleWorking() { + if test -n "${2:-}"; then + checkModuleWorking_iniFile="$PHP_INI_DIR/conf.d/$2--temp.ini" + else + checkModuleWorking_iniFile="$PHP_INI_DIR/conf.d/docker-php-ext-$1--temp.ini" + fi + checkModuleWorking_iniContent="$(buildPhpExtensionIniContent "$1" "${3:-}")" + printf 'Check if the %s module can be loaded... ' "$1" + checkModuleWorking_errBefore="$(php -r 'return;' 2>&1 || true)" + printf '%s' "$checkModuleWorking_iniContent" >"$checkModuleWorking_iniFile" + checkModuleWorking_errAfter="$(php -r 'return;' 2>&1 || true)" + rm "$checkModuleWorking_iniFile" + if test "$checkModuleWorking_errAfter" != "$checkModuleWorking_errBefore"; then + printf 'Error loading the "%s" extension:\n%s\n' "$1" "$checkModuleWorking_errAfter" >&2 + return 1 + fi + printf 'ok.\n' + return 0 +} + +# Enable a PHP extension +# +# Arguments: +# $1: the name of the PHP extension to be enabled +# $2: base name (without path and extension) of additional php.ini configuration (optional) +# $3: additional php.ini configuration (optional) +enablePhpExtension() { + if test -n "${2:-}"; then + enablePhpExtension_iniFile="$PHP_INI_DIR/conf.d/$2.ini" + else + enablePhpExtension_iniFile="$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" + fi + enablePhpExtension_iniContent="$(buildPhpExtensionIniContent "$1" "${3:-}")" + case "${IPE_DONT_ENABLE:-}" in + 1 | y* | Y*) + enablePhpExtension_enableCommand="/usr/local/bin/docker-php-ext-enable-$1" + printf '%s' "$enablePhpExtension_iniContent" >"$enablePhpExtension_iniFile-disabled" + printf '\n' >>"$enablePhpExtension_iniFile-disabled" + cat <"$enablePhpExtension_enableCommand" +#!/bin/sh + +if test -f '$enablePhpExtension_iniFile-disabled'; then + echo 'Enabling extension $1' + mv '$enablePhpExtension_iniFile-disabled' '$enablePhpExtension_iniFile' +else + echo 'The extension $1 has already been enabled' +fi +EOT + chmod +x "$enablePhpExtension_enableCommand" + printf '## Extension %s not enabled.\nYou can enable it by running the following command:\n%s\n\n' "$1" "$(basename "$enablePhpExtension_enableCommand")" + ;; + *) + printf '%s' "$enablePhpExtension_iniContent" >"$enablePhpExtension_iniFile" + printf '\n' >>"$enablePhpExtension_iniFile" + ;; + esac +} + +# Mark the pre-installed APT/APK packages as used +# that way they won't be uninstalled by accident +markPreinstalledPackagesAsUsed() { + printf '### MARKING PRE-INSTALLED PACKAGES AS IN-USE ###\n' + case "$DISTRO" in + alpine) + printf '# Packages: %s\n' "$PACKAGES_PERSISTENT_PRE" + apk add $PACKAGES_PERSISTENT_PRE + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + ;; + esac +} + +# Install the required APT/APK packages +# +# Arguments: +# $@: the list of APT/APK packages to be installed +installRequiredPackages() { + printf '### INSTALLING REQUIRED PACKAGES ###\n' + printf '# Packages to be kept after installation: %s\n' "$PACKAGES_PERSISTENT_NEW" + printf '# Packages to be used only for installation: %s\n' "$PACKAGES_VOLATILE" + case "$DISTRO" in + alpine) + apk add $IPE_APK_FLAGS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + # https://gitlab.alpinelinux.org/alpine/aports/-/issues/12763#note_172090 + # https://github.com/mlocati/docker-php-extension-installer/issues/385 + # https://github.com/mlocati/docker-php-extension-installer/issues/537#issuecomment-1078748882 + for installRequiredPackages_item in wget; do + if test -n "$(expandInstalledSystemPackageName "$installRequiredPackages_item")"; then + apk add --upgrade "$installRequiredPackages_item" + fi + done + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + ;; + esac +} + +# Get the version of an installed APT/APK package +# +# Arguments: +# $1: the name of the installed package +# +# Output: +# The numeric part of the package version, with from 1 to 3 numbers +# +# Example: +# 1 +# 1.2 +# 1.2.3 +getInstalledPackageVersion() { + case "$DISTRO" in + alpine) + apk info "$1" | head -n1 | cut -c $((${#1} + 2))- | grep -o -E '^[0-9]+(\.[0-9]+){0,2}' + ;; + debian) + dpkg-query --showformat='${Version}' --show "$1" 2>/dev/null | grep -o -E '^[0-9]+(\.[0-9]+){0,2}' + ;; + esac +} + +# Compare two versions +# +# Arguments: +# $1: the first version +# $2: the second version +# +# Output +# -1 if $1 is less than $2 +# 0 if $1 is the same as $2 +# 1 if $1 is greater than $2 +compareVersions() { + compareVersions_v1="$1.0.0" + compareVersions_v2="$2.0.0" + compareVersions_vMin="$(printf '%s\n%s' "$compareVersions_v1" "$compareVersions_v2" | sort -t '.' -n -k1,1 -k2,2 -k3,3 | head -n 1)" + if test "$compareVersions_vMin" != "$compareVersions_v1"; then + echo '1' + elif test "$compareVersions_vMin" = "$compareVersions_v2"; then + echo '0' + else + echo '-1' + fi +} + +# Install Oracle Instant Client & SDK +# +# Set: +# ORACLE_INSTANTCLIENT_LIBPATH +installOracleInstantClient() { + case "${IPE_INSTANTCLIENT_BASIC:-}" in + 1 | y* | Y*) + installOracleInstantClient_handle=basic + ;; + *) + installOracleInstantClient_handle=basiclite + ;; + esac + case $PHP_BITS in + 32) + installOracleInstantClient_client=client + installOracleInstantClient_version='19.9' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-$installOracleInstantClient_handle-linux-$installOracleInstantClient_version.0.0.0dbru.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-sdk-linux-$installOracleInstantClient_version.0.0.0dbru.zip + ;; + *) + case $(uname -m) in + aarch64*) + installOracleInstantClient_client=client64 + installOracleInstantClient_version='19.10' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-$installOracleInstantClient_handle-linux.arm64-$installOracleInstantClient_version.0.0.0dbru.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-sdk-linux.arm64-$installOracleInstantClient_version.0.0.0dbru.zip + ;; + *) + installOracleInstantClient_client=client64 + installOracleInstantClient_version='21.1' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-$installOracleInstantClient_handle-linux.x64-$installOracleInstantClient_version.0.0.0.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-sdk-linux.x64-$installOracleInstantClient_version.0.0.0.zip + ;; + esac + ;; + esac + ORACLE_INSTANTCLIENT_LIBPATH=/usr/lib/oracle/$installOracleInstantClient_version/$installOracleInstantClient_client/lib + if ! test -e "$ORACLE_INSTANTCLIENT_LIBPATH"; then + printf 'Downloading Oracle Instant Client v%s (%s)... ' "$installOracleInstantClient_version" "$installOracleInstantClient_handle" + installOracleInstantClient_src="$(getPackageSource $installOracleInstantClient_ic)" + mkdir -p "/usr/lib/oracle/$installOracleInstantClient_version/$installOracleInstantClient_client" + mv "$installOracleInstantClient_src" "$ORACLE_INSTANTCLIENT_LIBPATH" + echo 'done.' + fi + if ! test -e "$ORACLE_INSTANTCLIENT_LIBPATH/sdk"; then + printf 'Downloading Oracle Instant SDK v%s... ' "$installOracleInstantClient_version" + installOracleInstantClient_src="$(getPackageSource $installOracleInstantClient_sdk)" + ln -sf "$installOracleInstantClient_src/sdk" "$ORACLE_INSTANTCLIENT_LIBPATH/sdk" + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS '$ORACLE_INSTANTCLIENT_LIBPATH/sdk'" + echo 'done.' + fi + case "$DISTRO" in + alpine) + if ! test -e /usr/lib/libresolv.so.2 && test -e /lib/libc.so.6; then + ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 + fi + installOracleInstantClient_ldconf=/etc/ld-musl-${TARGET_TRIPLET%-alpine-linux-musl}.path + if test -e "$installOracleInstantClient_ldconf"; then + if ! cat "$installOracleInstantClient_ldconf" | grep -q "$ORACLE_INSTANTCLIENT_LIBPATH"; then + cat "$ORACLE_INSTANTCLIENT_LIBPATH" | awk -v suffix=":$ORACLE_INSTANTCLIENT_LIBPATH" '{print NR==1 ? $0suffix : $0}' >"$ORACLE_INSTANTCLIENT_LIBPATH" + fi + else + case $PHP_BITS in + 32) + echo "/lib:/usr/local/lib:/usr/lib:$ORACLE_INSTANTCLIENT_LIBPATH" >"$installOracleInstantClient_ldconf" + ;; + *) + echo "/lib64:/lib:/usr/local/lib:/usr/lib:$ORACLE_INSTANTCLIENT_LIBPATH" >"$installOracleInstantClient_ldconf" + ;; + esac + fi + ;; + debian) + if ! test -e /etc/ld.so.conf.d/oracle-instantclient.conf; then + echo "$ORACLE_INSTANTCLIENT_LIBPATH" >/etc/ld.so.conf.d/oracle-instantclient.conf + ldconfig + fi + ;; + esac +} + +# Check if the Microsoft SQL Server ODBC Driver is installed +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +isMicrosoftSqlServerODBCInstalled() { + test -d /opt/microsoft/msodbcsql*/ +} + +# Install the Microsoft SQL Server ODBC Driver +installMicrosoftSqlServerODBC() { + printf 'Installing the Microsoft SQL Server ODBC Driver\n' + case "$DISTRO" in + alpine) + # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#alpine17 + rm -rf /tmp/src/msodbcsql.apk + if test $PHP_MAJMIN_VERSION -le 703; then + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.9.1.1-1_amd64.apk + else + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/msodbcsql18_18.0.1.1-1_amd64.apk + fi + printf '\n' | apk add --allow-untrusted /tmp/src/msodbcsql.apk + rm -rf /tmp/src/msodbcsql.apk + ;; + debian) + # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#debian17 + printf -- '- installing the Microsoft APT key\n' + if test $DISTRO_VERSION_NUMBER -ge 11; then + # apt-key is deprecated + curl -sSLf -o /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc + else + curl -sSLf https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + fi + if ! test -f /etc/apt/sources.list.d/mssql-release.list; then + printf -- '- adding the Microsoft APT source list\n' + curl -sSLf https://packages.microsoft.com/config/debian/$DISTRO_VERSION_NUMBER/prod.list >/etc/apt/sources.list.d/mssql-release.list + invokeAptGetUpdate + fi + printf -- '- installing the APT package\n' + if test $PHP_MAJMIN_VERSION -le 703; then + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + elif test $DISTRO_VERSION_NUMBER -ge 9 && $DISTRO_VERSION_NUMBER -le 11; then + # On Debian 9 and 11 we have both msodbcsql17 and msodbcsql18: let's install just one + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + else + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + fi + ;; + esac +} + +# Check if libaom is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibaomInstalled() { + if ! test -f /usr/local/lib/libaom.so && ! test -f /usr/lib/libaom.so; then + return 1 + fi + if ! test -f /usr/local/include/aom/aom_codec.h && ! test -f /usr/include/aom/aom_codec.h; then + return 1 + fi + return 0 +} + +# Install libaom +installLibaom() { + printf 'Installing libaom\n' + installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v3.3.0.tar.gz)" + mkdir -- "$installLibaom_dir/my.build" + cd -- "$installLibaom_dir/my.build" + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DCMAKE_INSTALL_LIBDIR:PATH=lib .. + ninja -j $(getProcessorCount) install + cd - >/dev/null + ldconfig || true +} + +# Check if libdav1d is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibdav1dInstalled() { + if ! test -f /usr/local/lib/libdav1d.so && ! test -f /usr/lib/libdav1d.so && ! test -f /usr/lib/x86_64*/libdav1d.so; then + return 1 + fi + if ! test -f /usr/local/include/dav1d/dav1d.h && ! test -f /usr/include/dav1d/dav1d.h; then + return 1 + fi + return 0 +} + +# Install libdav1d +installLibdav1d() { + printf 'Installing libdav1d\n' + installLibdav1d_dir="$(getPackageSource https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz)" + mkdir -- "$installLibdav1d_dir/build" + cd -- "$installLibdav1d_dir/build" + meson --buildtype release -Dprefix=/usr .. + ninja -j $(getProcessorCount) install + cd - >/dev/null + if test -f /usr/lib/$TARGET_TRIPLET/libdav1d.so && ! test -f /usr/lib/libdav1d.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libdav1d.so /usr/lib/ + fi + ldconfig || true +} + +# Check if libyuv is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibyuvInstalled() { + if ! test -f /usr/local/lib/libyuv.so && ! test -f /usr/lib/libyuv.so && ! test -f /usr/lib/x86_64*/libyuv.so; then + return 1 + fi + if ! test -f /usr/local/include/libyuv.h && ! test -f /usr/include/libyuv.h; then + return 1 + fi + return 0 +} + +# Install libyuv +installLibyuv() { + printf 'Installing libyuv\n' + installLibyuv_dir="$(getPackageSource https://chromium.googlesource.com/libyuv/libyuv/+archive/25d0a5110be796eef47004412baf43333d9ecf26.tar.gz)" + mkdir -- "$installLibyuv_dir/build" + cd -- "$installLibyuv_dir/build" + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -B. .. + make -j$(getProcessorCount) install + cd - >/dev/null +} + +# Check if libavif is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibavifInstalled() { + if ! test -f /usr/local/lib/libavif.so && ! test -f /usr/lib/libavif.so && ! test -f /usr/lib/x86_64*/libavif.so; then + return 1 + fi + if ! test -f /usr/local/include/avif/avif.h && ! test -f /usr/include/avif/avif.h; then + return 1 + fi + return 0 +} + +# Install libavif +installLibavif() { + printf 'Installing libavif\n' + installLibavif_dir="$(getPackageSource https://codeload.github.com/AOMediaCodec/libavif/tar.gz/refs/tags/v0.9.3)" + mkdir -- "$installLibavif_dir/build" + cd -- "$installLibavif_dir/build" + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DAVIF_CODEC_AOM=ON -DCMAKE_INSTALL_LIBDIR:PATH=lib + make -j$(getProcessorCount) install + cd - >/dev/null +} + +# Install Composer +installComposer() { + installComposer_version="$(getWantedPHPModuleVersion @composer)" + installComposer_version="${installComposer_version#^}" + if test -z "$installComposer_version"; then + installComposer_fullname=composer + installComposer_flags='' + else + installComposer_fullname="$(printf 'composer v%s' "$installComposer_version")" + if printf '%s' "$installComposer_version" | grep -Eq '^[0-9]+$'; then + installComposer_flags="--$installComposer_version" + else + installComposer_flags="--version=$installComposer_version" + fi + fi + printf '### INSTALLING %s ###\n' "$installComposer_fullname" + actuallyInstallComposer /usr/local/bin composer "$installComposer_flags" +} + +# Actually install composer +# +# Arguments: +# $1: the directory where composer should be installed (required) +# $2: the composer filename (optional, default: composer) +# $3. additional flags for the composer installed (optional) +actuallyInstallComposer() { + actuallyInstallComposer_installer="$(mktemp -p /tmp/src)" + curl -sSLf -o "$actuallyInstallComposer_installer" https://getcomposer.org/installer + actuallyInstallComposer_expectedSignature="$(curl -sSLf https://composer.github.io/installer.sig)" + actuallyInstallComposer_actualSignature="$(php -n -r "echo hash_file('sha384', '$actuallyInstallComposer_installer');")" + if test "$actuallyInstallComposer_expectedSignature" != "$actuallyInstallComposer_actualSignature"; then + printf 'Verification of composer installer failed!\nExpected signature: %s\nActual signature: %s\n' "$actuallyInstallComposer_expectedSignature" "$actuallyInstallComposer_actualSignature" >&2 + exit 1 + fi + actuallyInstallComposer_flags="--install-dir=$1" + if test -n "${2:-}"; then + actuallyInstallComposer_flags="$actuallyInstallComposer_flags --filename=$2" + else + actuallyInstallComposer_flags="$actuallyInstallComposer_flags --filename=composer" + fi + if test -n "${3:-}"; then + actuallyInstallComposer_flags="$actuallyInstallComposer_flags $3" + fi + php "$actuallyInstallComposer_installer" $actuallyInstallComposer_flags + rm -- "$actuallyInstallComposer_installer" +} + +# Install ionCube Loader +installIonCubeLoader() { + # See https://www.ioncube.com/loaders.php + case $PHP_BITS in + 32) + case $(uname -m) in + aarch* | arm*) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + ;; + *) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + ;; + esac + ;; + *) + case $(uname -m) in + aarch64 | arm64 | armv8) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + ;; + *) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + ;; + esac + ;; + esac + printf 'Downloading ionCube Loader... ' + installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" + echo 'done.' + installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") + cp "$installIonCubeLoader_dir/$installIonCubeLoader_so" "$(getPHPExtensionsDir)/ioncube_loader.so" +} + +# Install SourceGuardian Loader +installSourceGuardian() { + # See https://www.sourceguardian.com/loaders.html + case $PHP_BITS in + 32) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-i386.tar.gz + ;; + *) + case $(uname -m) in + aarch64 | arm64 | armv8) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz + ;; + *) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz + ;; + esac + ;; + esac + printf 'Downloading SourceGuardian... ' + installSourceGuardian_dir="$(getPackageSource $installSourceGuardian_url)" + printf 'done (version: %s)\n' "$(cat "$installSourceGuardian_dir/version")" + for installSourceGuardian_phpv in $PHP_MAJDOTMINDOTPAT_VERSION $PHP_MAJDOTMIN_VERSION; do + installSourceGuardian_file="$installSourceGuardian_dir/ixed.$PHP_MAJDOTMIN_VERSION" + if test $PHP_THREADSAFE -eq 1; then + installSourceGuardian_file="${installSourceGuardian_file}ts" + fi + installSourceGuardian_file="${installSourceGuardian_file}.lin" + if test -f "$installSourceGuardian_file"; then + mv "$installSourceGuardian_file" "$(getPHPExtensionsDir)/sourceguardian.so" + return + fi + done + printf 'Unable to find a SourceGuardian compatible with PHP %s or PHP %s.\nAvailable SourceGuardian versions:\n' "$PHP_MAJDOTMINDOTPAT_VERSION" "$PHP_MAJDOTMIN_VERSION" >&2 + ls -1 "$installSourceGuardian_dir" | grep -E '^ixed\..*\.lin$' | sed -E 's/^[^0-9]+([0-9]+(\.[0-9]+)*).*$/\1/' | sort | uniq >&2 + exit 1 +} + +# Install a bundled PHP module given its handle +# +# Arguments: +# $1: the handle of the PHP module +# +# Set: +# UNNEEDED_PACKAGE_LINKS +# +# Output: +# Nothing +installBundledModule() { + printf '### INSTALLING BUNDLED MODULE %s ###\n' "$1" + if test -n "$(getWantedPHPModuleVersion "$1")"; then + printf '### WARNING the module "%s" is bundled with PHP, you can NOT specify a version for it\n' "$1" >&2 + fi + if test -n "$(getModuleSourceCodePath "$1")"; then + printf '### WARNING the module "%s" is bundled with PHP, you can NOT specify a source code path for it\n' "$1" >&2 + fi + case "$1" in + dba) + if test -e /usr/lib/$TARGET_TRIPLET/libdb-5.3.so && ! test -e /usr/lib/libdb-5.3.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libdb-5.3.so /usr/lib/ + fi + if test $PHP_MAJMIN_VERSION -le 505; then + docker-php-source extract + patch /usr/src/php/ext/dba/config.m4 </dev/null + fi + ;; + gd) + if test $PHP_MAJMIN_VERSION -le 506; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-vpx-dir + elif test $PHP_MAJMIN_VERSION -le 701; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-webp-dir + elif test $PHP_MAJMIN_VERSION -le 703; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --with-webp-dir + elif test $PHP_MAJMIN_VERSION -le 800; then + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype + else + installBundledModule_tmp=0 + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -ge 315; then + installBundledModule_tmp=1 + fi + ;; + esac + if test $installBundledModule_tmp -eq 0; then + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + if ! isLibaomInstalled; then + installLibaom + fi + if ! isLibdav1dInstalled; then + installLibdav1d + fi + if ! isLibyuvInstalled; then + installLibyuv + fi + if ! isLibavifInstalled; then + installLibavif + fi + ;; + esac + if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then + installBundledModule_tmp=1 + fi + fi + if test $installBundledModule_tmp -eq 1; then + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif + else + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype + fi + fi + ;; + gmp) + if test $PHP_MAJMIN_VERSION -le 506; then + if ! test -f /usr/include/gmp.h; then + ln -s /usr/include/$TARGET_TRIPLET/gmp.h /usr/include/gmp.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/gmp.h" + fi + fi + ;; + imap) + case "$DISTRO_VERSION" in + debian@9) + installBundledModule_tmp="$(pwd)" + cd /tmp + apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* + rm libc-client2007e-dev* + cd "$installBundledModule_tmp" + ;; + esac + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl + ;; + interbase | pdo_firebird) + case "$DISTRO" in + alpine) + if ! test -d /tmp/src/firebird; then + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi + CFLAGS='-I/tmp/src/firebird/src/jrd -I/tmp/src/firebird/src/include -I/tmp/src/firebird/src/include/gen' docker-php-ext-configure $1 + ;; + esac + ;; + ldap) + case "$DISTRO" in + debian) + docker-php-ext-configure ldap --with-libdir=lib/$TARGET_TRIPLET + ;; + esac + ;; + mssql | pdo_dblib) + if ! test -f /usr/lib/libsybdb.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libsybdb.so /usr/lib/libsybdb.so + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/lib/libsybdb.so" + fi + ;; + odbc) + docker-php-source extract + cd /usr/src/php/ext/odbc + phpize + sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure + ./configure --with-unixODBC=shared,/usr + cd - >/dev/null + ;; + oci8 | pdo_oci) + installOracleInstantClient + if test "$1" = oci8; then + docker-php-ext-configure "$1" "--with-oci8=instantclient,$ORACLE_INSTANTCLIENT_LIBPATH" + elif test "$1" = pdo_oci; then + docker-php-ext-configure "$1" "--with-pdo-oci=instantclient,$ORACLE_INSTANTCLIENT_LIBPATH" + fi + ;; + pdo_odbc) + docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr + ;; + snmp) + case "$DISTRO" in + alpine) + mkdir -p -m 0755 /var/lib/net-snmp/mib_indexes + ;; + esac + ;; + sockets) + case "$PHP_MAJDOTMINDOTPAT_VERSION" in + 8.0.15 | 8.1.2) + sed -i '70 i #ifndef _GNU_SOURCE' /usr/src/php/ext/sockets/config.m4 + sed -i '71 i #define _GNU_SOURCE' /usr/src/php/ext/sockets/config.m4 + sed -i '72 i #endif' /usr/src/php/ext/sockets/config.m4 + ;; + esac + ;; + sybase_ct) + docker-php-ext-configure sybase_ct --with-sybase-ct=/usr + ;; + tidy) + case "$DISTRO" in + alpine) + if ! test -f /usr/include/buffio.h; then + ln -s /usr/include/tidybuffio.h /usr/include/buffio.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/buffio.h" + fi + ;; + esac + ;; + zip) + if test $PHP_MAJMIN_VERSION -le 505; then + docker-php-ext-configure zip + elif test $PHP_MAJMIN_VERSION -le 703; then + docker-php-ext-configure zip --with-libzip + else + docker-php-ext-configure zip --with-zip + fi + ;; + esac + installBundledModule_errBefore="$(php -r 'return;' 2>&1 || true)" + docker-php-ext-install -j$(getProcessorCount) "$1" + case "$1" in + imap) + case "$DISTRO_VERSION" in + debian@9) + dpkg -r libc-client2007e-dev + ;; + esac + ;; + esac + php -r 'return;' >/dev/null 2>/dev/null || true + installBundledModule_errAfter="$(php -r 'return;' 2>&1 || true)" + if test "$installBundledModule_errAfter" != "$installBundledModule_errBefore"; then + printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_errAfter" >&2 + rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true + return 1 + fi +} + +# Fetch a tar.gz file, extract it and returns the path of the extracted folder. +# +# Arguments: +# $1: the URL of the file to be downloaded +# +# Output: +# The path of the extracted directory +getPackageSource() { + mkdir -p /tmp/src + getPackageSource_tempFile=$(mktemp -p /tmp/src) + curl -sSLf -o "$getPackageSource_tempFile" "$1" + getPackageSource_tempDir=$(mktemp -p /tmp/src -d) + cd "$getPackageSource_tempDir" + tar -xzf "$getPackageSource_tempFile" 2>/dev/null || tar -xf "$getPackageSource_tempFile" 2>/dev/null || ( + if command -v bsdtar >/dev/null; then + bsdtar -xf "$getPackageSource_tempFile" + else + unzip -q "$getPackageSource_tempFile" + fi + ) + cd - >/dev/null + unlink "$getPackageSource_tempFile" + getPackageSource_outDir='' + for getPackageSource_i in $(ls "$getPackageSource_tempDir"); do + if test -n "$getPackageSource_outDir" || test -f "$getPackageSource_tempDir/$getPackageSource_i"; then + getPackageSource_outDir='' + break + fi + getPackageSource_outDir="$getPackageSource_tempDir/$getPackageSource_i" + done + if test -n "$getPackageSource_outDir"; then + printf '%s' "$getPackageSource_outDir" + else + printf '%s' "$getPackageSource_tempDir" + fi +} + +# Install a PECL/remote PHP module given its handle +# +# Arguments: +# $1: the handle of the PHP module +installRemoteModule() { + installRemoteModule_module="$1" + printf '### INSTALLING REMOTE MODULE %s ###\n' "$installRemoteModule_module" + installRemoteModule_version="$(resolveWantedPHPModuleVersion "$installRemoteModule_module")" + installRemoteModule_path="$(getModuleSourceCodePath "$installRemoteModule_module")" + rm -rf "$CONFIGURE_FILE" + installRemoteModule_manuallyInstalled=0 + installRemoteModule_cppflags='' + installRemoteModule_ini_basename='' + installRemoteModule_ini_extra='' + case "$installRemoteModule_module" in + amqp) + if test -z "$installRemoteModule_version"; then + if test "$DISTRO_VERSION" = debian@8; then + # in Debian Jessie we have librabbitmq version 0.5.2 + installRemoteModule_version=1.9.3 + elif test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version=1.9.4 + fi + fi + ;; + apcu) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=4.0.11 + fi + fi + ;; + apcu_bc) + # apcu_bc must be loaded after apcu + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + ast) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.0.16 + fi + fi + ;; + blackfire) + case $(uname -m) in + i386 | i686 | x86) + installRemoteModule_tmp1=i386 + ;; + aarch64 | arm64 | armv8) + installRemoteModule_tmp1=arm64 + ;; + *) + installRemoteModule_tmp1=amd64 + ;; + esac + case $DISTRO in + alpine) + installRemoteModule_distro=alpine + ;; + *) + installRemoteModule_distro=linux + ;; + esac + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" + cd "$installRemoteModule_tmp" + curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz + mv blackfire-*.so $(getPHPExtensionsDir)/blackfire.so + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + installRemoteModule_ini_extra="$(printf '%sblackfire.agent_socket=tcp://blackfire:8307\n' "$installRemoteModule_ini_extra")" + ;; + cassandra) + installRemoteModule_src="$(getPackageSource https://github.com/nano-interactive/ext-cassandra/tarball/1cf12c5ce49ed43a2c449bee4b7b23ce02a37bf0)" + cd "$installRemoteModule_src/ext" + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + ;; + cmark) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.1.0 + fi + fi + if ! test -e /usr/local/lib/libcmark.so && ! test -e /usr/local/lib64/libcmark.so && ! test -e /usr/lib/libcmark.so && ! test -e /usr/lib64/libcmark.so && ! test -e /lib/libcmark.so; then + if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then + installRemoteModule_tmp=0.29.0 + else + installRemoteModule_tmp=0.30.3 + fi + cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" + make -s -j$(getProcessorCount) cmake_build + make -s -j$(getProcessorCount) install + cd - >/dev/null + case "$DISTRO" in + alpine) + if test -e /usr/local/lib64/libcmark.so.$installRemoteModule_tmp && ! test -e /usr/local/lib/libcmark.so.$installRemoteModule_tmp; then + ln -s /usr/local/lib64/libcmark.so.$installRemoteModule_tmp /usr/local/lib/ + fi + ;; + *) + ldconfig || true + ;; + esac + fi + ;; + csv) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=0.3.1 + fi + fi + ;; + ddtrace) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.75.0 + fi + fi + ;; + decimal) + case "$DISTRO" in + alpine) + if ! test -f /usr/local/lib/libmpdec.so; then + installRemoteModule_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure --disable-cxx + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + ;; + esac + ;; + ds) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=1.3.0 + fi + fi + ;; + event) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then + # Enable internal debugging in Event + addConfigureOption enable-event-debug no + # Enable sockets support in Event + if php --ri sockets >/dev/null 2>/dev/null; then + addConfigureOption enable-event-sockets yes + else + addConfigureOption enable-event-sockets no + fi + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in Event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # PHP Namespace for all Event classes + if test -n "${IPE_EVENT_NAMESPACE:-}"; then + addConfigureOption with-event-ns "$IPE_EVENT_NAMESPACE" + else + addConfigureOption with-event-ns no + fi + # openssl installation prefix + addConfigureOption with-openssl-dir yes + elif test $(compareVersions "$installRemoteModule_version" 1.7.6) -ge 0; then + # Enable internal debugging in Event + addConfigureOption enable-event-debug no + # Enable sockets support in Event + if php --ri sockets >/dev/null 2>/dev/null; then + addConfigureOption enable-event-sockets yes + else + addConfigureOption enable-event-sockets no + fi + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in Event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # openssl installation prefix + addConfigureOption with-openssl-dir no + elif test $(compareVersions "$installRemoteModule_version" 1.3.0) -ge 0; then + # Enable internal debugging in event + addConfigureOption enable-event-debug no + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # openssl installation prefix + addConfigureOption with-openssl-dir no + fi + # event must be loaded after sockets + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + excimer) + if test -z "$installRemoteModule_version"; then + if test "$DISTRO" = alpine && test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.0.4 + fi + fi + ;; + gearman) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.2 + fi + fi + case "$DISTRO" in + alpine) + if ! test -e /usr/local/include/libgearman/gearman.h || ! test -e /usr/local/lib/libgearman.so; then + installRemoteModule_src="$(getPackageSource https://github.com/gearman/gearmand/releases/download/1.1.20/gearmand-1.1.20.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure + make -j$(getProcessorCount) install-binPROGRAMS + make -j$(getProcessorCount) install-nobase_includeHEADERS + cd - >/dev/null + fi + ;; + esac + ;; + geoip) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + geos) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=71b5f9001512e16d3cf4657b517e8a051d6ef36f + fi + installRemoteModule_src="$(getPackageSource https://git.osgeo.org/gitea/geos/php-geos/archive/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + ./autogen.sh + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + geospatial) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.2.1 + else + installRemoteModule_version=beta + fi + fi + ;; + gmagick) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.7RC3 + else + installRemoteModule_version=beta + fi + fi + ;; + grpc) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.33.1 + fi + fi + if test -z "$installRemoteModule_version" || test "$installRemoteModule_version" = 1.35.0; then + case "$DISTRO_VERSION" in + alpine@3.13) + installRemoteModule_cppflags='-Wno-maybe-uninitialized' + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + installRemoteModule_version=1.46.3 + ;; + esac + fi + ;; + http) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.6.0 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=3.2.4 + fi + fi + if test $PHP_MAJMIN_VERSION -ge 700; then + if ! test -e /usr/local/lib/libidnkit.so; then + installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" + cd -- "$installRemoteModule_src" + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + fi + fi + # http must be loaded after raphf and propro + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + igbinary) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.8 + fi + fi + ;; + inotify) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.1.6 + fi + fi + ;; + ion) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=alpha + fi + if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then + echo 'Installing ion-c... ' + installRemoteModule_src="$(mktemp -p /tmp/src -d)" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.1 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + ( + cd "$installRemoteModule_src/ion" + git submodule init -q + git submodule update -q + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + make clean + make -j$(getProcessorCount) install + ) + rm -rf "$installRemoteModule_src" + fi + addConfigureOption with-ion "shared,/usr/local" + ;; + ioncube_loader) + installIonCubeLoader + installRemoteModule_manuallyInstalled=1 + ;; + jsmin) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=2.0.1 + fi + fi + ;; + luasandbox) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 702; then + installRemoteModule_version=3.0.3 + fi + fi + ;; + lz4) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.4.3 + fi + installRemoteModule_src="$(getPackageSource https://github.com/kjdev/php-ext-lz4/archive/refs/tags/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + phpize + ./configure --with-lz4-includedir=/usr + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + lzf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 702; then + installRemoteModule_version=1.6.8 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Sacrifice speed in favour of compression ratio? + case "${IPE_LZF_BETTERCOMPRESSION:-}" in + 1 | y* | Y*) + addConfigureOption 'enable-lzf-better-compression' 'yes' + ;; + *) + addConfigureOption 'enable-lzf-better-compression' 'no' + ;; + esac + fi + ;; + mailparse) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.1.6 + elif test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=3.1.3 + fi + fi + ;; + memcache) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.2.7 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=4.0.5.2 + fi + fi + ;; + memcached) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.2.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + # Set the path to libmemcached install prefix + addConfigureOption 'with-libmemcached-dir' 'no' + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '3.0.0') -ge 0; then + # Set the path to ZLIB install prefix + addConfigureOption 'with-zlib-dir' 'no' + # Use system FastLZ library + addConfigureOption 'with-system-fastlz' 'no' + # Enable memcached igbinary serializer support + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption 'enable-memcached-igbinary' 'yes' + else + addConfigureOption 'enable-memcached-igbinary' 'no' + fi + # Enable memcached msgpack serializer support + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption 'enable-memcached-msgpack' 'yes' + else + addConfigureOption 'enable-memcached-msgpack' 'no' + fi + # Enable memcached json serializer support + addConfigureOption 'enable-memcached-json' 'yes' + # Enable memcached protocol support + addConfigureOption 'enable-memcached-protocol' 'no' # https://github.com/php-memcached-dev/php-memcached/issues/418#issuecomment-449587972 + # Enable memcached sasl support + addConfigureOption 'enable-memcached-sasl' 'yes' + # Enable memcached session handler support + addConfigureOption 'enable-memcached-session' 'yes' + fi + # memcached must be loaded after msgpack + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + memprof) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.0 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.0 + fi + fi + ;; + mongo) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Build with Cyrus SASL (MongoDB Enterprise Authentication) support? + addConfigureOption '-with-mongo-sasl' 'yes' + fi + ;; + mongodb) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version=1.5.5 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.7.5 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=1.9.2 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.11.1 + fi + fi + ;; + mosquitto) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + msgpack) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.5.7 + fi + fi + ;; + oauth) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.2.3 + fi + fi + ;; + opencensus) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=alpha + fi + ;; + openswoole) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 704; then + installRemoteModule_version=4.10.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if php --ri sockets >/dev/null 2>/dev/null; then + installRemoteModule_sockets=yes + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + else + installRemoteModule_sockets=no + fi + installRemoteModule_openssl=yes + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '22.8.0') -ge 0; then + #enable hook curl support? + addConfigureOption enable-hook-curl yes + # enable postgres support? + addConfigureOption with-postgres yes + else + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '4.8.0') -ge 0; then + # enable postgres support? + addConfigureOption with-postgres yes + fi + fi + ;; + parallel) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=0.8.3 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=1.1.4 + fi + fi + ;; + parle) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + pcov) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=0.9.0 + fi + fi + ;; + php_trie) + if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then + installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" + mkdir -p /usr/local/include/hat-trie + mv "$installRemoteModule_src/include" /usr/local/include/hat-trie + fi + ;; + propro) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.2 + fi + fi + ;; + protobuf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=3.12.4 + else + # see https://github.com/protocolbuffers/protobuf/issues/10619 + installRemoteModule_version=3.21.6 + fi + fi + ;; + pthreads) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.10 + fi + fi + ;; + raphf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.2 + fi + fi + ;; + rdkafka) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + installRemoteModule_version1='' + if test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version1=3.0.5 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version1=4.1.2 + fi + installRemoteModule_version2='' + case "$DISTRO" in + alpine) + installRemoteModule_tmp='librdkafka' + ;; + debian) + installRemoteModule_tmp='librdkafka*' + ;; + *) + installRemoteModule_tmp='' + ;; + esac + if test -n "$installRemoteModule_tmp"; then + installRemoteModule_tmp="$(getInstalledPackageVersion "$installRemoteModule_tmp")" + if test -n "$installRemoteModule_tmp" && test $(compareVersions "$installRemoteModule_tmp" '0.11.0') -lt 0; then + installRemoteModule_version2=3.1.3 + fi + fi + if test -z "$installRemoteModule_version1" || test -z "$installRemoteModule_version2"; then + installRemoteModule_version="$installRemoteModule_version1$installRemoteModule_version2" + elif test $(compareVersions "$installRemoteModule_version1" "$installRemoteModule_version2") -le 0; then + installRemoteModule_version="$installRemoteModule_version1" + else + installRemoteModule_version="$installRemoteModule_version2" + fi + fi + ;; + redis) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=4.3.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + # Enable igbinary serializer support? + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption 'enable-redis-igbinary' 'yes' + else + addConfigureOption 'enable-redis-igbinary' 'no' + fi + # Enable lzf compression support? + addConfigureOption 'enable-redis-lzf' 'yes' + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '5.0.0') -ge 0; then + if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$TARGET_TRIPLET/libzstd.so"; then + installRemoteModule_zstdVersion=1.4.4 + installRemoteModule_zstdVersionMajor=$(echo $installRemoteModule_zstdVersion | cut -d. -f1) + rm -rf /tmp/src/zstd + mv "$(getPackageSource https://github.com/facebook/zstd/releases/download/v$installRemoteModule_zstdVersion/zstd-$installRemoteModule_zstdVersion.tar.gz)" /tmp/src/zstd + cd /tmp/src/zstd + make V=0 -j$(getProcessorCount) lib + cp -f lib/libzstd.so "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" + ln -sf "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersionMajor" + ln -sf "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" "/usr/lib/$TARGET_TRIPLET/libzstd.so" + ln -sf /tmp/src/zstd/lib/zstd.h /usr/include/zstd.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h" + cd - >/dev/null + fi + # Enable zstd compression support? + addConfigureOption 'enable-redis-zstd' 'yes' + fi + ;; + relay) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version="$(curl -sSLf https://builds.r2.relay.so/meta/latest)" + installRemoteModule_version="${installRemoteModule_version#v}" + fi + case $(uname -m) in + aarch64 | arm64 | armv8) + installRemoteModule_hardware=aarch64 + ;; + *) + installRemoteModule_hardware=x86-64 + ;; + esac + printf 'Downloading relay v%s (%s)... ' "$installRemoteModule_version" "$installRemoteModule_hardware" + installRemoteModule_url="https://builds.r2.relay.so/v${installRemoteModule_version}/relay-v${installRemoteModule_version}-php${PHP_MAJDOTMIN_VERSION}-${DISTRO}-${installRemoteModule_hardware}.tar.gz" + installRemoteModule_src="$(getPackageSource $installRemoteModule_url)" + echo 'done.' + cp -- "$installRemoteModule_src/relay-pkg.so" "$PHP_EXTDIR/relay.so" + sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" "$PHP_EXTDIR/relay.so" + installRemoteModule_ini_extra="$(grep -vE '^[ \t]*extension[ \t]*=' $installRemoteModule_src/relay.ini)" + installRemoteModule_manuallyInstalled=1 + ;; + snappy) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.2.1 + fi + installRemoteModule_src="$(getPackageSource https://github.com/kjdev/php-ext-snappy/archive/refs/tags/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + phpize + ./configure --with-snappy-includedir=/usr + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + snuffleupagus) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.8.2 + fi + installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" + cd "$installRemoteModule_src/src" + phpize + ./configure --enable-snuffleupagus + make -j$(getProcessorCount) install + cd - >/dev/null + cp -a "$installRemoteModule_src/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules" + if test $(compareVersions "$installRemoteModule_version" 0.8.0) -ge 0; then + printf '\n# Disable "PHP version is not officially maintained anymore" message\nsp.global.show_old_php_warning.disable();\n' >>"$PHP_INI_DIR/conf.d/snuffleupagus.rules" + fi + else + if test -f "$installRemoteModule_path/config/default.rules"; then + cp -a "$installRemoteModule_path/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules" + fi + fi + installRemoteModule_ini_extra="$(printf '%ssp.configuration_file=%s\n' "$installRemoteModule_ini_extra" "$PHP_INI_DIR/conf.d/snuffleupagus.rules")" + installRemoteModule_manuallyInstalled=1 + ;; + sodium | libsodium) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=1.0.7 + fi + fi + ;; + solr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.4.0 + fi + fi + ;; + sourceguardian) + installSourceGuardian + installRemoteModule_manuallyInstalled=1 + ;; + spx) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=v0.4.13 + fi + if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then + installRemoteModule_displayVersion="$installRemoteModule_version" + else + installRemoteModule_displayVersion="git--master-$installRemoteModule_version" + fi + installRemoteModule_src="$(getPackageSource https://codeload.github.com/NoiseByNorthwest/php-spx/tar.gz/$installRemoteModule_version)" + cd -- "$installRemoteModule_src" + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + sqlsrv | pdo_sqlsrv) + isMicrosoftSqlServerODBCInstalled || installMicrosoftSqlServerODBC + if test -z "$installRemoteModule_version"; then + # https://docs.microsoft.com/it-it/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-2017 + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=3.0.1 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=5.3.0 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=5.6.1 + elif test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=5.8.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=5.9.0 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=5.10.1 + fi + fi + ;; + ssh2) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.13 + else + installRemoteModule_version=beta + fi + fi + ;; + stomp) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.9 + fi + fi + if test "$DISTRO" = debian; then + addConfigureOption with-openssl-dir yes + else + addConfigureOption with-openssl-dir /usr + fi + ;; + swoole) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 502; then + installRemoteModule_version=1.6.10 + elif test $PHP_MAJMIN_VERSION -le 504; then + installRemoteModule_version=2.0.4 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.11 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=4.3.6 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=4.5.10 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=4.8.11 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if php --ri sockets >/dev/null 2>/dev/null; then + installRemoteModule_sockets=yes + else + installRemoteModule_sockets=no + fi + installRemoteModule_openssl=yes + case "$DISTRO_VERSION" in + alpine@3.7 | alpine@3.8) + if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + # see https://github.com/swoole/swoole-src/issues/3934 + installRemoteModule_openssl=no + fi + ;; + esac + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + elif test $(compareVersions "$installRemoteModule_version" 5.0.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + elif test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + elif test $(compareVersions "$installRemoteModule_version" 4.6.1) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.11) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.7) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + # enable kernel debug/trace log? (it will degrade performance) + addConfigureOption enable-debug-log no + elif test $(compareVersions "$installRemoteModule_version" 4.2.6) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-debug-log no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.0) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-debug-log no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 2.1.2) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-swoole-debug no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 1.10.4) -ge 0 && test $(compareVersions "$installRemoteModule_version" 1.10.5) -le 0; then + # enable debug/trace log support? + addConfigureOption enable-swoole-debug no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + fi + ;; + tdlib) + if ! test -f /usr/lib/libphpcpp.so || ! test -f /usr/include/phpcpp.h; then + if test $PHP_MAJMIN_VERSION -le 701; then + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/v2.1.4)" + elif test $PHP_MAJMIN_VERSION -le 703; then + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/v2.2.0)" + else + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/444d1f90cf6b7f3cb5178fa0d0b5ab441b0389d0)" + fi + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + if test -z "$installRemoteModule_path"; then + installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" + git clone --depth=1 --recurse-submodules https://github.com/yaroslavche/phptdlib.git "$installRemoteModule_tmp" + mkdir "$installRemoteModule_tmp/build" + cd "$installRemoteModule_tmp/build" + cmake -D USE_SHARED_PHPCPP:BOOL=ON .. + make + make install + cd - >/dev/null + rm "$PHP_INI_DIR/conf.d/tdlib.ini" + installRemoteModule_manuallyInstalled=1 + fi + ;; + tensor) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=2.2.3 + fi + fi + ;; + uopz) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.7 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=5.0.2 + elif test $PHP_MAJMIN_VERSION -le 740; then + installRemoteModule_version=6.1.2 + fi + fi + ;; + uploadprogress) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.1.4 + fi + fi + ;; + uuid) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.5 + fi + fi + ;; + xdebug) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 500; then + installRemoteModule_version=2.0.5 + elif test $PHP_MAJMIN_VERSION -le 503; then + installRemoteModule_version=2.2.7 + elif test $PHP_MAJMIN_VERSION -le 504; then + installRemoteModule_version=2.4.1 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.5.5 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.6.1 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=2.9.8 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=3.1.6 + fi + fi + ;; + xdiff) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.5.2 + fi + fi + if ! test -f /usr/local/lib/libxdiff.* && ! test -f /usr/lib/libxdiff.* && ! test -f /usr/lib/x86_64*/libxdiff.*; then + installRemoteModule_src="$(getPackageSource https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/assets/resources/libxdiff-0.23.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure --disable-shared --disable-dependency-tracking --with-pic + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + ;; + xhprof) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.9.4 + fi + fi + ;; + xlswriter) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.2.7) -ge 0; then + # enable reader supports? + addConfigureOption enable-reader yes + fi + ;; + xmlrpc) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + yac) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.9.2 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.2.0) -ge 0; then + # Enable igbinary serializer support + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption enable-igbinary yes + else + addConfigureOption enable-igbinary no + fi + # Enable json serializer support + if php --ri json >/dev/null 2>/dev/null; then + addConfigureOption enable-json yes + else + addConfigureOption enable-json no + fi + # Enable msgpack serializer support + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption enable-msgpack yes + else + addConfigureOption enable-msgpack no + fi + fi + ;; + yaml) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.3.1 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.0.4 + fi + fi + ;; + yar) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.2.5 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.2.4) -ge 0; then + # Enable Msgpack Supports + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption enable-msgpack yes + else + addConfigureOption enable-msgpack no + fi + fi + ;; + zmq) + if test -z "$installRemoteModule_version"; then + installRemoteModule_src="$(getPackageSource https://github.com/zeromq/php-zmq/tarball/master)" + cd "$installRemoteModule_src" + phpize + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + zookeeper) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.5.0 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=1.0.0 + else + installRemoteModule_version=alpha + fi + fi + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + case "$DISTRO" in + alpine) + if ! test -f /usr/local/include/zookeeper/zookeeper.h; then + if test $(compareVersions "$installRemoteModule_version" 1.0.0) -lt 0; then + installRemoteModule_src="$(getPackageSource http://archive.apache.org/dist/zookeeper/zookeeper-3.5.9/apache-zookeeper-3.5.9.tar.gz)" + else + installRemoteModule_tmp="$(curl -sSLf https://downloads.apache.org/zookeeper/stable | sed -E 's/["<>]/\n/g' | grep -E '^(apache-)?zookeeper-[0-9]+\.[0-9]+\.[0-9]+\.(tar\.gz|tgz)$' | head -n1)" + if test -z "$installRemoteModule_tmp"; then + echo 'Failed to detect the zookeeper library URL' >&2 + exit 1 + fi + installRemoteModule_src="$(getPackageSource https://downloads.apache.org/zookeeper/stable/$installRemoteModule_tmp)" + fi + cd -- "$installRemoteModule_src" + if test -d ~/.m2; then + installRemoteModule_delm2=n + else + installRemoteModule_delm2=y + fi + mvn -pl zookeeper-jute compile + cd - >/dev/null + cd -- "$installRemoteModule_src/zookeeper-client/zookeeper-client-c" + autoreconf -if + ./configure --without-cppunit + make -j$(getProcessorCount) CFLAGS='-Wno-stringop-truncation -Wno-format-overflow' + make install + cd - >/dev/null + if test $installRemoteModule_delm2 = y; then + rm -rf ~/.m2 + fi + fi + ;; + esac + ;; + zstd) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.11.0 + fi + fi + ;; + esac + if test $installRemoteModule_manuallyInstalled -eq 0; then + if test -n "$installRemoteModule_path"; then + printf ' (installing version %s from %s)\n' "$installRemoteModule_version" "$installRemoteModule_path" + elif test -n "$installRemoteModule_version"; then + printf ' (installing version %s)\n' "$installRemoteModule_version" + fi + installPeclPackage "$installRemoteModule_module" "$installRemoteModule_version" "$installRemoteModule_cppflags" "$installRemoteModule_path" + fi + postProcessModule "$installRemoteModule_module" + checkModuleWorking "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra" + enablePhpExtension "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra" +} + +# Check if a module/helper may be installed using the pecl archive +# +# Arguments: +# $1: the name of the module +# +# Return: +# 0: true +# 1: false +moduleMayUsePecl() { + case "$1" in + @composer | @fix_letsencrypt) + return 1 + ;; + blackfire | geos | ioncube_loader | snuffleupagus | sourceguardian | spx | tdlib) + return 1 + ;; + esac + if test -n "$(getModuleSourceCodePath "$1")"; then + return 1 + fi + if stringInList "$1" "$BUNDLED_MODULES"; then + return 1 + fi + return 0 +} + +# Configure the PECL package installer +# +# Updates: +# PHP_MODULES_TO_INSTALL +# Sets: +# USE_PICKLE 0: no, 1: yes (already downloaded), 2: yes (build it from source) +configureInstaller() { + USE_PICKLE=0 + if ! which pecl >/dev/null; then + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do + if ! moduleMayUsePecl "$PHP_MODULE_TO_INSTALL"; then + continue + fi + if false && anyStringInList '' "$PHP_MODULES_TO_INSTALL"; then + USE_PICKLE=2 + else + curl -sSLf https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /tmp/pickle + chmod +x /tmp/pickle + USE_PICKLE=1 + fi + break + done + fi + if test $USE_PICKLE -eq 0; then + if test -z "$(pear config-get http_proxy)"; then + if test -n "${http_proxy:-}"; then + pear config-set http_proxy "$http_proxy" || true + elif test -n "${HTTP_PROXY:-}"; then + pear config-set http_proxy "$HTTP_PROXY" || true + fi + fi + pecl channel-update pecl.php.net || true + fi +} + +buildPickle() { + printf '### BUILDING PICKLE ###\n' + buildPickle_tempDir="$(mktemp -p /tmp/src -d)" + cd -- "$buildPickle_tempDir" + printf 'Downloading... ' + git clone --quiet --depth 1 https://github.com/FriendsOfPHP/pickle.git . + git tag 0.7.0 + printf 'done.\n' + printf 'Installing composer... ' + actuallyInstallComposer . composer '--1 --quiet' + printf 'done.\n' + printf 'Installing composer dependencies... ' + ./composer install --no-dev --no-progress --no-suggest --optimize-autoloader --ignore-platform-reqs --quiet --no-cache + printf 'done.\n' + printf 'Building... ' + php -d phar.readonly=0 box.phar build + mv pickle.phar /tmp/pickle + printf 'done.\n' + cd - >/dev/null +} + +# Add a configure option for the pecl/pickle install command +# +# Arguments: +# $1: the option name +# $2: the option value +addConfigureOption() { + if test $USE_PICKLE -eq 0; then + printf -- '%s\n' "$2" >>"$CONFIGURE_FILE" + else + printf -- '--%s=%s\n' "$1" "$2" >>"$CONFIGURE_FILE" + fi +} + +# Actually installs a PECL package +# +# Arguments: +# $1: the package to be installed +# $2: the package version to be installed (optional) +# $3: the value of the CPPFLAGS variable (optional) +# $4: the path of the local package to be installed (optional, downloaded from PECL if omitted/empty) +installPeclPackage() { + if ! test -f "$CONFIGURE_FILE"; then + printf '\n' >"$CONFIGURE_FILE" + fi + installPeclPackage_name="$(getPeclModuleName "$1")" + if test -z "${2:-}"; then + installPeclPackage_fullname="$installPeclPackage_name" + else + installPeclPackage_fullname="$installPeclPackage_name-$2" + fi + installPeclPackage_path="${4:-}" + if test -z "$installPeclPackage_path"; then + installPeclPackage_path="$installPeclPackage_fullname" + fi + if test $USE_PICKLE -eq 0; then + if test -n "${4:-}"; then + if test -f "$installPeclPackage_path/package2.xml"; then + installPeclPackage_path="$installPeclPackage_path/package2.xml" + else + installPeclPackage_path="$installPeclPackage_path/package.xml" + fi + fi + cat "$CONFIGURE_FILE" | MAKE="make -j$(getCompilationProcessorCount $1)" CPPFLAGS="${3:-}" pecl install "$installPeclPackage_path" + else + MAKEFLAGS="-j$(getCompilationProcessorCount $1)" CPPFLAGS="${3:-}" /tmp/pickle install --tmp-dir=/tmp/pickle.tmp --no-interaction --version-override='' --with-configure-options "$CONFIGURE_FILE" -- "$installPeclPackage_path" + fi +} + +# Check if a string is in a list of space-separated string +# +# Arguments: +# $1: the string to be checked +# $2: the string list +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +stringInList() { + for stringInList_listItem in $2; do + if test "$1" = "$stringInList_listItem"; then + return 0 + fi + done + return 1 +} + +# Check if at least one item in a list is in another list +# +# Arguments: +# $1: the space-separated list of items to be searched +# $2: the space-separated list of reference items +# +# Return: +# 0 (true): at least one of the items in $1 is in $2 +# 1 (false): otherwise +anyStringInList() { + for anyStringInList_item in $1; do + if stringInList "$anyStringInList_item" "$2"; then + return 0 + fi + done + return 1 +} + +# Remove a word from a space-separated list +# +# Arguments: +# $1: the word to be removed +# $2: the string list +# +# Output: +# The list without the word +removeStringFromList() { + removeStringFromList_result='' + for removeStringFromList_listItem in $2; do + if test "$1" != "$removeStringFromList_listItem"; then + if test -z "$removeStringFromList_result"; then + removeStringFromList_result="$removeStringFromList_listItem" + else + removeStringFromList_result="$removeStringFromList_result $removeStringFromList_listItem" + fi + fi + done + printf '%s' "$removeStringFromList_result" +} + +# Invoke apt-get update +# +# Set: +# IPE_APTGET_INSTALLOPTIONS +invokeAptGetUpdate() { + if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then + DEBIAN_FRONTEND=noninteractive apt-get update -q + return + fi + IPE_APTGET_INSTALLOPTIONS='' + if ! grep -q 'VERSION="8 (jessie)"' /etc/os-release; then + DEBIAN_FRONTEND=noninteractive apt-get update -q + return + fi + invokeAptGetUpdate_tmp="$(mktemp)" + DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + if test -s "$invokeAptGetUpdate_tmp"; then + cat "$invokeAptGetUpdate_tmp" >&2 + if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then + IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' + echo '############' >&2 + echo '# WARNING! #' >&2 + echo '############' >&2 + echo 'apt packages will be installed without checking authenticity!' >&2 + fi + fi + rm "$invokeAptGetUpdate_tmp" + IPE_APTGETUPDATE_ALREADY=y +} + +# Fix the Let's Encrypt CA certificates on old distros +fixLetsEncrypt() { + printf '### FIXING LETS ENCRYPT CA CERTIFICATES ###\n' + case "$DISTRO_VERSION" in + alpine@3.7 | alpine@3.8) + printf -- '- old Alpine Linux detected: we should fix the certificates\n' + ;; + debian@8 | debian@9) + printf -- '- old Debian detected: we should fix the certificates\n' + if ! grep -q 'mozilla/ISRG_Root_X1.crt' /etc/ca-certificates.conf && grep -q 'mozilla/DST_Root_CA_X3.crt' /etc/ca-certificates.conf; then + printf -- '- old ca-certificates package detected\n' + fixCACerts_mustUpdate=1 + if test -d /var/lib/apt/lists; then + for fixCACerts_item in $(ls -1 /var/lib/apt/lists); do + case "$fixCACerts_item" in + partial | lock) ;; + *) + fixCACerts_mustUpdate=0 + break + ;; + esac + done + fi + if test $fixCACerts_mustUpdate -eq 1; then + printf -- '- refreshing the APT package list\n' + invokeAptGetUpdate + fi + printf -- '- installing newer ca-certificates package\n' + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS ca-certificates + fi + ;; + *) + printf -- '- patch not required in this distro version\n' + return + ;; + esac + if grep -Eq '^mozilla/ISRG_Root_X1\.crt$' /etc/ca-certificates.conf && grep -Eq '^mozilla/DST_Root_CA_X3\.crt$' /etc/ca-certificates.conf; then + printf -- '- disabling the DST_Root_CA_X3 certificate\n' + sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf + printf -- '- refreshing the certificates\n' + update-ca-certificates -f + else + printf -- '- DST_Root_CA_X3 certificate not found or already disabled\n' + fi +} + +# Cleanup everything at the end of the execution +cleanup() { + if test -n "$UNNEEDED_PACKAGE_LINKS"; then + printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' + for cleanup_link in $UNNEEDED_PACKAGE_LINKS; do + if test -L "$cleanup_link"; then + rm -f "$cleanup_link" + fi + done + fi + if test -n "$PACKAGES_VOLATILE"; then + printf '### REMOVING UNNEEDED PACKAGES ###\n' + case "$DISTRO" in + alpine) + apk del --purge $PACKAGES_VOLATILE + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + ;; + esac + fi + if test -n "$PACKAGES_PREVIOUS"; then + case "$DISTRO" in + debian) + printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + ;; + esac + fi + docker-php-source delete + rm -rf /tmp/src + rm -rf /tmp/pickle + rm -rf /tmp/pickle.tmp + rm -rf "$CONFIGURE_FILE" + case "${IPE_KEEP_SYSPKG_CACHE:-}" in + 1 | y* | Y*) ;; + *) + case "$DISTRO" in + alpine) + rm -rf /var/cache/apk/* + ;; + debian) + rm -rf /var/lib/apt/lists/* + ;; + esac + rm -rf /tmp/pear + ;; + esac +} + +resetIFS +mkdir -p /tmp/src +mkdir -p /tmp/pickle.tmp +IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)" +CONFIGURE_FILE=/tmp/configure-options +IPE_APK_FLAGS='' +setDistro +case "$DISTRO_VERSION" in + debian@8) + fixMaxOpenFiles || true + ;; +esac +setPHPVersionVariables +setPHPPreinstalledModules +case "$PHP_MAJMIN_VERSION" in + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802) ;; + *) + printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) + ;; +esac +UNNEEDED_PACKAGE_LINKS='' +processCommandArguments "$@" + +if test -z "$PHP_MODULES_TO_INSTALL"; then + exit 0 +fi + +if stringInList @fix_letsencrypt "$PHP_MODULES_TO_INSTALL"; then + # This must be the very first thing we do + fixLetsEncrypt +fi + +sortModulesToInstall + +docker-php-source extract +BUNDLED_MODULES="$(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | xargs -n1 dirname | xargs -n1 basename | xargs)" +configureInstaller + +buildRequiredPackageLists $PHP_MODULES_TO_INSTALL +if test -n "$PACKAGES_PERSISTENT_PRE"; then + markPreinstalledPackagesAsUsed +fi +if test -n "$PACKAGES_PERSISTENT_NEW$PACKAGES_VOLATILE"; then + installRequiredPackages +fi +if test "$PHP_MODULES_TO_INSTALL" != '@composer'; then + setTargetTriplet +fi +if test $USE_PICKLE -gt 1; then + buildPickle +fi +for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do + case "$PHP_MODULE_TO_INSTALL" in + @fix_letsencrypt) + # Already done: it must be the first thing we do + ;; + @composer) + installComposer + ;; + *) + if stringInList "$PHP_MODULE_TO_INSTALL" "$BUNDLED_MODULES"; then + installBundledModule "$PHP_MODULE_TO_INSTALL" + else + installRemoteModule "$PHP_MODULE_TO_INSTALL" + fi + ;; + esac +done +cleanup diff --git a/apps/php7/versions/7.4.33/build/php/extensions/install.sh b/apps/php7/versions/7.4.33/build/php/extensions/install.sh new file mode 100644 index 00000000..010897d6 --- /dev/null +++ b/apps/php7/versions/7.4.33/build/php/extensions/install.sh @@ -0,0 +1,731 @@ +#!/bin/sh + +export MC="-j$(nproc)" + +echo +echo "============================================" +echo "Install extensions from : install.sh" +echo "PHP version : ${PHP_VERSION}" +echo "Extra Extensions : ${PHP_EXTENSIONS}" +echo "Multicore Compilation : ${MC}" +echo "Container package url : ${CONTAINER_PACKAGE_URL}" +echo "Work directory : ${PWD}" +echo "============================================" +echo + + +if [ "${PHP_EXTENSIONS}" != "" ]; then + apk --update add --no-cache --virtual .build-deps autoconf g++ libtool make curl-dev gettext-dev linux-headers +fi + + +export EXTENSIONS=",${PHP_EXTENSIONS}," + + +# +# Check if current php version is greater than or equal to +# specific version. +# +# For example, to check if current php is greater than or +# equal to PHP 7.0: +# +# isPhpVersionGreaterOrEqual 7 0 +# +# Param 1: Specific PHP Major version +# Param 2: Specific PHP Minor version +# Return : 1 if greater than or equal to, 0 if less than +# +isPhpVersionGreaterOrEqual() + { + local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;") + local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;") + + if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then + return 1; + else + return 0; + fi +} + + +# +# Install extension from package file(.tgz), +# For example: +# +# installExtensionFromTgz redis-5.2.2 +# +# Param 1: Package name with version +# Param 2: enable options +# +installExtensionFromTgz() +{ + tgzName=$1 + para1= + extensionName="${tgzName%%-*}" + + if [ $2 ]; then + para1=$2 + fi + mkdir ${extensionName} + tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 + ( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) + + docker-php-ext-enable ${extensionName} +} + + +if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then + echo "---------- Install pdo_mysql ----------" + docker-php-ext-install ${MC} pdo_mysql +fi + +if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then + echo "---------- Install pcntl ----------" + docker-php-ext-install ${MC} pcntl +fi + +if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then + echo "---------- Install mysqli ----------" + docker-php-ext-install ${MC} mysqli +fi + +if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then + echo "---------- mbstring is installed ----------" +fi + +if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then + echo "---------- Install exif ----------" + docker-php-ext-install ${MC} exif +fi + +if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then + echo "---------- Install bcmath ----------" + docker-php-ext-install ${MC} bcmath +fi + +if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then + echo "---------- Install calendar ----------" + docker-php-ext-install ${MC} calendar +fi + +if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then + echo "---------- Install zend_test ----------" + docker-php-ext-install ${MC} zend_test +fi + +if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then + echo "---------- Install opcache ----------" + docker-php-ext-install opcache +fi + +if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then + echo "---------- Install sockets ----------" + docker-php-ext-install ${MC} sockets +fi + +if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then + echo "---------- Install gettext ----------" + apk --no-cache add gettext-dev + docker-php-ext-install ${MC} gettext + +fi + +if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then + echo "---------- Install shmop ----------" + docker-php-ext-install ${MC} shmop +fi + +if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then + echo "---------- Install sysvmsg ----------" + docker-php-ext-install ${MC} sysvmsg +fi + +if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then + echo "---------- Install sysvsem ----------" + docker-php-ext-install ${MC} sysvsem +fi + +if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then + echo "---------- Install sysvshm ----------" + docker-php-ext-install ${MC} sysvshm +fi + +if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then + echo "---------- Install pdo_firebird ----------" + docker-php-ext-install ${MC} pdo_firebird +fi + +if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then + echo "---------- Install pdo_dblib ----------" + docker-php-ext-install ${MC} pdo_dblib +fi + +if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then + echo "---------- Install pdo_oci ----------" + docker-php-ext-install ${MC} pdo_oci +fi + +if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then + echo "---------- Install pdo_odbc ----------" + docker-php-ext-install ${MC} pdo_odbc +fi + +if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then + echo "---------- Install pdo_pgsql ----------" + apk --no-cache add postgresql-dev \ + && docker-php-ext-install ${MC} pdo_pgsql +fi + +if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then + echo "---------- Install pgsql ----------" + apk --no-cache add postgresql-dev \ + && docker-php-ext-install ${MC} pgsql +fi + +if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then + echo "---------- Install oci8 ----------" + docker-php-ext-install ${MC} oci8 +fi + +if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then + echo "---------- Install odbc ----------" + docker-php-ext-install ${MC} odbc +fi + +if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then + echo "---------- Install dba ----------" + docker-php-ext-install ${MC} dba +fi + +if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then + echo "---------- Install interbase ----------" + echo "Alpine linux do not support interbase/firebird!!!" + #docker-php-ext-install ${MC} interbase +fi + +if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then + echo "---------- Install hprose ----------" + printf "\n" | pecl install hprose + docker-php-ext-enable hprose +fi + +if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then + echo "---------- Install gd ----------" + isPhpVersionGreaterOrEqual 7 4 + + 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 + + apk add --no-cache \ + freetype \ + freetype-dev \ + libpng \ + libpng-dev \ + libjpeg-turbo \ + libjpeg-turbo-dev \ + libwebp-dev \ + && docker-php-ext-configure gd ${options} \ + && docker-php-ext-install ${MC} gd \ + && apk del \ + freetype-dev \ + libpng-dev \ + libjpeg-turbo-dev +fi + +if [[ -z "${EXTENSIONS##*,yaml,*}" ]]; then + echo "---------- Install yaml ----------" + apk add --no-cache yaml-dev + printf "\n" | pecl install yaml + docker-php-ext-enable yaml +fi + +if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then + echo "---------- Install intl ----------" + apk add --no-cache icu-dev + docker-php-ext-install ${MC} intl +fi + +if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then + echo "---------- Install bz2 ----------" + apk add --no-cache bzip2-dev + docker-php-ext-install ${MC} bz2 +fi + +if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then + echo "---------- Install soap ----------" + apk add --no-cache libxml2-dev + docker-php-ext-install ${MC} soap +fi + +if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then + echo "---------- Install xsl ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} xsl +fi + +if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then + echo "---------- Install xmlrpc ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} xmlrpc +fi + +if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then + echo "---------- Install wddx ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} wddx +fi + +if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then + echo "---------- curl is installed ----------" +fi + +if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then + echo "---------- Install readline ----------" + apk add --no-cache readline-dev + apk add --no-cache libedit-dev + docker-php-ext-install ${MC} readline +fi + +if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then + echo "---------- Install snmp ----------" + apk add --no-cache net-snmp-dev + docker-php-ext-install ${MC} snmp +fi + +if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then + echo "---------- Install pspell ----------" + apk add --no-cache aspell-dev + apk add --no-cache aspell-en + docker-php-ext-install ${MC} pspell +fi + +if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then + echo "---------- Install recode ----------" + apk add --no-cache recode-dev + docker-php-ext-install ${MC} recode +fi + +if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then + echo "---------- Install tidy ----------" + apk add --no-cache tidyhtml-dev + + # Fix: https://github.com/htacg/tidy-html5/issues/235 + ln -s /usr/include/tidybuffio.h /usr/include/buffio.h + + docker-php-ext-install ${MC} tidy +fi + +if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then + echo "---------- Install gmp ----------" + apk add --no-cache gmp-dev + docker-php-ext-install ${MC} gmp +fi + +if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then + echo "---------- Install imap ----------" + apk add --no-cache imap-dev + docker-php-ext-configure imap --with-imap --with-imap-ssl + docker-php-ext-install ${MC} imap +fi + +if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then + echo "---------- Install ldap ----------" + apk add --no-cache ldb-dev + apk add --no-cache openldap-dev + docker-php-ext-install ${MC} ldap +fi + +if [[ -z "${EXTENSIONS##*,psr,*}" ]]; then + echo "---------- Install psr ----------" + printf "\n" | pecl install psr + docker-php-ext-enable psr +fi + +if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then + echo "---------- Install imagick ----------" + apk add --no-cache file-dev + apk add --no-cache imagemagick-dev + printf "\n" | pecl install imagick-3.4.4 + docker-php-ext-enable imagick +fi + +if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then + echo "---------- Install rar ----------" + printf "\n" | pecl install rar + docker-php-ext-enable rar +fi + +if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then + echo "---------- Install ast ----------" + printf "\n" | pecl install ast + docker-php-ext-enable ast +fi + +if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then + echo "---------- Install msgpack ----------" + printf "\n" | pecl install msgpack + docker-php-ext-enable msgpack +fi + +if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then + echo "---------- Install igbinary ----------" + printf "\n" | pecl install igbinary + docker-php-ext-enable igbinary +fi + + +if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then + 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 >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install protobuf ----------" + printf "\n" | pecl install protobuf + docker-php-ext-enable protobuf + else + echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then + 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 >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install yar ----------" + printf "\n" | pecl install yar + docker-php-ext-enable yar + else + echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" + fi + +fi + + + +if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install yaconf ----------" + printf "\n" | pecl install yaconf + docker-php-ext-enable yaconf + else + echo "yar requires PHP >= 7.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then + echo "---------- Install seaslog ----------" + printf "\n" | pecl install seaslog + docker-php-ext-enable seaslog +fi + +if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then + echo "---------- Install varnish ----------" + apk add --no-cache varnish-dev + printf "\n" | pecl install varnish + docker-php-ext-enable varnish +fi + +if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then + isPhpVersionGreaterOrEqual 7 1 + if [[ "$?" = "1" ]]; then + echo "---------- Install pdo_sqlsrv ----------" + apk add --no-cache unixodbc-dev + printf "\n" | pecl install pdo_sqlsrv + docker-php-ext-enable pdo_sqlsrv + curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk + apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + else + echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then + isPhpVersionGreaterOrEqual 7 1 + if [[ "$?" = "1" ]]; then + echo "---------- Install sqlsrv ----------" + apk add --no-cache unixodbc-dev + printf "\n" | pecl install sqlsrv + docker-php-ext-enable sqlsrv + else + echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install mcrypt ----------" + apk add --no-cache libmcrypt-dev libmcrypt re2c + printf "\n" |pecl install mcrypt + docker-php-ext-enable mcrypt + else + echo "---------- Install mcrypt ----------" + apk add --no-cache libmcrypt-dev \ + && docker-php-ext-install ${MC} mcrypt + fi +fi + +if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then + 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 + isPhpVersionGreaterOrEqual 7 2 + if [[ "$?" = "1" ]]; then + echo + echo "Sodium is bundled with PHP from PHP 7.2.0" + echo + else + echo "---------- Install sodium ----------" + apk add --no-cache libsodium-dev + docker-php-ext-install ${MC} sodium + fi +fi + +if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then + echo "---------- Install amqp ----------" + apk add --no-cache rabbitmq-c-dev + installExtensionFromTgz amqp-1.10.2 +fi + +if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then + echo "---------- Install redis ----------" + isPhpVersionGreaterOrEqual 7 0 + if [[ "$?" = "1" ]]; then + installExtensionFromTgz redis-5.2.2 + else + printf "\n" | pecl install redis-4.3.0 + docker-php-ext-enable redis + fi +fi + +if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then + echo "---------- Install apcu ----------" + installExtensionFromTgz apcu-5.1.17 +fi + +if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then + echo "---------- Install memcached ----------" + apk add --no-cache libmemcached-dev zlib-dev + 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 ----------" + 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 ----------" + 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 + echo "---------- Install event ----------" + apk add --no-cache libevent-dev + export is_sockets_installed=$(php -r "echo extension_loaded('sockets');") + + if [[ "${is_sockets_installed}" = "" ]]; then + echo "---------- event is depend on sockets, install sockets first ----------" + docker-php-ext-install sockets + fi + + echo "---------- Install event again ----------" + installExtensionFromTgz event-2.5.6 "--ini-name event.ini" +fi + +if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then + echo "---------- Install mongodb ----------" + installExtensionFromTgz mongodb-1.7.4 +fi + +if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then + echo "---------- Install yaf ----------" + 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++ + + isPhpVersionGreaterOrEqual 7 0 + + if [[ "$?" = "1" ]]; then + installExtensionFromTgz swoole-4.5.2 + 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 + + 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 7 0 + + if [[ "$?" = "1" ]]; then + mkdir xhprof \ + && 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>= 7.0----------" + fi + +fi + +if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then + echo "---------- Install xlswriter ----------" + isPhpVersionGreaterOrEqual 7 0 + + if [[ "$?" = "1" ]]; then + printf "\n" | pecl install xlswriter + docker-php-ext-enable xlswriter + else + echo "---------- PHP Version>= 7.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then + echo "---------- Install rdkafka ----------" + isPhpVersionGreaterOrEqual 5 6 + + if [[ "$?" = "1" ]]; then + apk add librdkafka-dev + printf "\n" | pecl install rdkafka + docker-php-ext-enable rdkafka + else + echo "---------- PHP Version>= 5.6----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then + echo "---------- Install zookeeper ----------" + 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>= 7.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then + echo "---------- Install phalcon ----------" + isPhpVersionGreaterOrEqual 7 2 + + if [[ "$?" = "1" ]]; then + printf "\n" | pecl install phalcon + docker-php-ext-enable psr + docker-php-ext-enable phalcon + else + echo "---------- PHP Version>= 7.2----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then + echo "---------- Install sdebug ----------" + isPhpVersionGreaterOrEqual 7 2 + + if [[ "$?" = "1" ]]; then + curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \ + && mkdir -p sdebug \ + && tar -xf sdebug.tar.gz -C sdebug --strip-components=1 \ + && rm sdebug.tar.gz \ + && ( \ + cd sdebug \ + && phpize \ + && ./configure --enable-xdebug \ + && make clean && make && make install \ + ) \ + && docker-php-ext-enable xdebug + else + echo "---------- PHP Version>= 7.2----------" + fi +fi + +if [ "${PHP_EXTENSIONS}" != "" ]; then + apk del .build-deps \ + && docker-php-source delete +fi diff --git a/apps/php7/versions/7.4.33/build/php/php-fpm.conf b/apps/php7/versions/7.4.33/build/php/php-fpm.conf new file mode 100644 index 00000000..13183589 --- /dev/null +++ b/apps/php7/versions/7.4.33/build/php/php-fpm.conf @@ -0,0 +1,423 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or NONE) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = www-data +;listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 10 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/local/share/php/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +slowlog = /var/log/php/fpm.slow.log + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_slowlog_timeout = 3 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr/local) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/apps/php7/versions/7.4.33/build/php/php.ini b/apps/php7/versions/7.4.33/build/php/php.ini new file mode 100644 index 00000000..30535103 --- /dev/null +++ b/apps/php7/versions/7.4.33/build/php/php.ini @@ -0,0 +1,1933 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 256M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +error_log = /var/log/php/php.error.log + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 100M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 50M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Asia/Shanghai + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: + +[XDebug] +xdebug.remote_enable = 1 +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/xdebug.log + +SERVER_ENV=develop + +yaf.use_spl_autoload=1 + +[xhprof] +;xhprof.output_dir = /var/log/php/xhprof.log \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/conf/php-fpm.conf b/apps/php7/versions/7.4.33/conf/php-fpm.conf new file mode 100644 index 00000000..13183589 --- /dev/null +++ b/apps/php7/versions/7.4.33/conf/php-fpm.conf @@ -0,0 +1,423 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or NONE) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = www-data +;listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 10 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/local/share/php/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +slowlog = /var/log/php/fpm.slow.log + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_slowlog_timeout = 3 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr/local) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/apps/php7/versions/7.4.33/conf/php.ini b/apps/php7/versions/7.4.33/conf/php.ini new file mode 100644 index 00000000..30535103 --- /dev/null +++ b/apps/php7/versions/7.4.33/conf/php.ini @@ -0,0 +1,1933 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 256M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +error_log = /var/log/php/php.error.log + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 100M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 50M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Asia/Shanghai + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: + +[XDebug] +xdebug.remote_enable = 1 +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/xdebug.log + +SERVER_ENV=develop + +yaf.use_spl_autoload=1 + +[xhprof] +;xhprof.output_dir = /var/log/php/xhprof.log \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/config.json b/apps/php7/versions/7.4.33/config.json new file mode 100644 index 00000000..f6f66c97 --- /dev/null +++ b/apps/php7/versions/7.4.33/config.json @@ -0,0 +1,13 @@ +{ + "formFields": [ + { + "type": "number", + "labelZh": "端口", + "labelEn": "Port", + "required": true, + "default": 9000, + "rule": "paramPort", + "envKey": "PANEL_APP_PORT_HTTP" + } + ] +} \ No newline at end of file diff --git a/apps/php7/versions/7.4.33/docker-compose.yml b/apps/php7/versions/7.4.33/docker-compose.yml new file mode 100644 index 00000000..6e019077 --- /dev/null +++ b/apps/php7/versions/7.4.33/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3" +services: + php: + image: ${IMAGE_NAME} + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + volumes: + - ${PANEL_WEBSITE_DIR}:/www/ + - ./conf/php.ini:/usr/local/etc/php/php.ini + - ./conf/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf + - ./log:/var/log/php + - ./composer:/tmp/composer + ports: + - ${PANEL_APP_PORT_HTTP}:9000 +networks: + 1panel-network: + external: true \ No newline at end of file diff --git a/apps/php8/metadata/logo.png b/apps/php8/metadata/logo.png new file mode 100644 index 00000000..569fc644 Binary files /dev/null and b/apps/php8/metadata/logo.png differ diff --git a/apps/php8/versions/8.2.0/README.md b/apps/php8/versions/8.2.0/README.md new file mode 100644 index 00000000..85cdf6c3 --- /dev/null +++ b/apps/php8/versions/8.2.0/README.md @@ -0,0 +1,141 @@ + + +# The PHP Interpreter + +PHP is a popular general-purpose scripting language that is especially suited to +web development. Fast, flexible and pragmatic, PHP powers everything from your +blog to the most popular websites in the world. PHP is distributed under the +[PHP License v3.01](LICENSE). + +[![Push](https://github.com/php/php-src/actions/workflows/push.yml/badge.svg)](https://github.com/php/php-src/actions/workflows/push.yml) +[![Build status](https://travis-ci.com/php/php-src.svg?branch=master)](https://travis-ci.com/github/php/php-src) +[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy/branch/master?svg=true)](https://ci.appveyor.com/project/php/php-src) +[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/php.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:php) + +## Documentation + +The PHP manual is available at [php.net/docs](https://php.net/docs). + +## Installation + +### Prebuilt packages and binaries + +Prebuilt packages and binaries can be used to get up and running fast with PHP. + +For Windows, the PHP binaries can be obtained from +[windows.php.net](https://windows.php.net). After extracting the archive the +`*.exe` files are ready to use. + +For other systems, see the [installation chapter](https://php.net/install). + +### Building PHP source code + +*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).* + +For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For +a default build, you will additionally need libxml2 and libsqlite3. + +On Ubuntu, you can install these using: + + sudo apt install -y pkg-config build-essential autoconf bison re2c \ + libxml2-dev libsqlite3-dev + +On Fedora, you can install these using: + + sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel + +Generate configure: + + ./buildconf + +Configure your build. `--enable-debug` is recommended for development, see +`./configure --help` for a full list of options. + + # For development + ./configure --enable-debug + # For production + ./configure + +Build PHP. To speed up the build, specify the maximum number of jobs using `-j`: + + make -j4 + +The number of jobs should usually match the number of available cores, which +can be determined using `nproc`. + +## Testing PHP source code + +PHP ships with an extensive test suite, the command `make test` is used after +successful compilation of the sources to run this test suite. + +It is possible to run tests using multiple cores by setting `-jN` in +`TEST_PHP_ARGS`: + + make TEST_PHP_ARGS=-j4 test + +Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum +number of jobs should not exceed the number of cores available. + +The [qa.php.net](https://qa.php.net) site provides more detailed info about +testing and quality assurance. + +## Installing PHP built from source + +After a successful build (and test), PHP may be installed with: + + make install + +Depending on your permissions and prefix, `make install` may need super user +permissions. + +## PHP extensions + +Extensions provide additional functionality on top of PHP. PHP consists of many +essential bundled extensions. Additional extensions can be found in the PHP +Extension Community Library - [PECL](https://pecl.php.net). + +## Contributing + +The PHP source code is located in the Git repository at +[github.com/php/php-src](https://github.com/php/php-src). Contributions are most +welcome by forking the repository and sending a pull request. + +Discussions are done on GitHub, but depending on the topic can also be relayed +to the official PHP developer mailing list internals@lists.php.net. + +New features require an RFC and must be accepted by the developers. See +[Request for comments - RFC](https://wiki.php.net/rfc) and +[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information +on the process. + +Bug fixes don't require an RFC. If the bug has a GitHub issue, reference it in +the commit message using `GH-NNNNNN`. Use `#NNNNNN` for tickets in the old +[bugs.php.net](https://bugs.php.net) bug tracker. + + Fix GH-7815: php_uname doesn't recognise latest Windows versions + Fix #55371: get_magic_quotes_gpc() throws deprecation warning + +See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for details on how pull +requests are merged. + +### Guidelines for contributors + +See further documents in the repository for more information on how to +contribute: + +- [Contributing to PHP](/CONTRIBUTING.md) +- [PHP coding standards](/CODING_STANDARDS.md) +- [Mailing list rules](/docs/mailinglist-rules.md) +- [PHP release process](/docs/release-process.md) + +## Credits + +For the list of people who've put work into PHP, please see the +[PHP credits page](https://php.net/credits.php). diff --git a/apps/php8/versions/8.2.0/build/.env b/apps/php8/versions/8.2.0/build/.env new file mode 100644 index 00000000..c7fb5f18 --- /dev/null +++ b/apps/php8/versions/8.2.0/build/.env @@ -0,0 +1,13 @@ +CONTAINER_PACKAGE_URL=mirrors.ustc.edu.cn + +PHP_VERSION=8.2.0 +PHP_PHP_CONF_FILE=./php/php.ini +PHP_FPM_CONF_FILE=./php/php-fpm.conf +PHP_LOG_DIR=./logs/php +PHP_EXTENSIONS= + +SOURCE_DIR=./www + +TZ=Asia/Shanghai +DATA_DIR=./data +IMAGE_NAME=1panel-php:8.2.0 \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/build/config.json b/apps/php8/versions/8.2.0/build/config.json new file mode 100644 index 00000000..eed3af6f --- /dev/null +++ b/apps/php8/versions/8.2.0/build/config.json @@ -0,0 +1,102 @@ +{ + "formFields": [ + { + "type": "select", + "multiple": true, + "labelZh": "扩展", + "labelEn": "Extensions", + "default": [], + "values": [ + { + "label": "opcache", + "value": "opcache" + }, + { + "label": "memcached", + "value": "memcached" + }, + { + "label": "memcache", + "value": "memcache" + }, + { + "label": "redis", + "value": "redis" + }, + { + "label": "mcrypt", + "value": "mcrypt" + }, + { + "label": "xdebug", + "value": "xdebug" + }, + { + "label": "imap", + "value": "imap" + }, + { + "label": "exif", + "value": "exif" + }, + { + "label": "intl", + "value": "intl" + }, + { + "label": "swoole", + "value": "swoole" + }, + { + "label": "yaf", + "value": "yaf" + }, + { + "label": "pgsql", + "value": "pgsql" + }, + { + "label": "pdo_pgsql", + "value": "pdo_pgsql" + }, + { + "label": "snmp", + "value": "snmp" + }, { + "label": "ldap", + "value": "ldap" + }, + { + "label": "pspell", + "value": "pspell" + }, + { + "label": "bz2", + "value": "bz2" + }, + { + "label": "sysvshm", + "value": "sysvshm" + }, + { + "label": "calendar", + "value": "calendar" + }, + { + "label": "gmp", + "value": "gmp" + }, + { + "label": "sysvmsg", + "value": "sysvmsg" + }, + { + "label": "igbinary", + "value": "igbinary" + } + ], + "envKey": "PHP_EXTENSIONS", + "edit": true + } + ] +} \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/build/docker-compose.yml b/apps/php8/versions/8.2.0/build/docker-compose.yml new file mode 100644 index 00000000..75246ffb --- /dev/null +++ b/apps/php8/versions/8.2.0/build/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3" +services: + 1panel-php: + build: + context: ./php + args: + PHP_IMAGE: php:${PHP_VERSION}-fpm-alpine + CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL} + PHP_EXTENSIONS: ${PHP_EXTENSIONS} + TZ: ${TZ} + image: ${IMAGE_NAME} + volumes: + - ${SOURCE_DIR}:/www/ + - ${PHP_PHP_CONF_FILE}:/usr/local/etc/php/php.ini + - ${PHP_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf + - ${PHP_LOG_DIR}:/var/log/php + - ${DATA_DIR}/composer:/tmp/composer + restart: always + cap_add: + - SYS_PTRACE + networks: + - default \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/build/php/Dockerfile b/apps/php8/versions/8.2.0/build/php/Dockerfile new file mode 100644 index 00000000..1e6b4447 --- /dev/null +++ b/apps/php8/versions/8.2.0/build/php/Dockerfile @@ -0,0 +1,40 @@ +ARG PHP_VERSION +FROM ${PHP_VERSION} + +ARG TZ +ARG PHP_EXTENSIONS +ARG CONTAINER_PACKAGE_URL + + +RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi + +COPY ./extensions /tmp/extensions +WORKDIR /tmp/extensions +RUN chmod +x install.sh \ + && sh install.sh \ + && rm -rf /tmp/extensions + +ADD ./extensions/install-php-extensions /usr/local/bin/ + +RUN chmod uga+x /usr/local/bin/install-php-extensions + +RUN apk --no-cache add tzdata \ + && cp "/usr/share/zoneinfo/$TZ" /etc/localtime \ + && echo "$TZ" > /etc/timezone + + +# Fix: https://github.com/docker-library/php/issues/240 +RUN apk add gnu-libiconv libstdc++ --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/community/ --allow-untrusted +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php + + +# Install composer and change it's cache home +RUN curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ + && chmod +x /usr/bin/composer +ENV COMPOSER_HOME=/tmp/composer + +# php image's www-data user uid & gid are 82, change them to 1000 (primary user) +RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data + + +WORKDIR /www diff --git a/apps/php8/versions/8.2.0/build/php/extensions/event-3.0.5.tgz b/apps/php8/versions/8.2.0/build/php/extensions/event-3.0.5.tgz new file mode 100644 index 00000000..98cb5768 Binary files /dev/null and b/apps/php8/versions/8.2.0/build/php/extensions/event-3.0.5.tgz differ diff --git a/apps/php8/versions/8.2.0/build/php/extensions/install-composer.sh b/apps/php8/versions/8.2.0/build/php/extensions/install-composer.sh new file mode 100644 index 00000000..34074732 --- /dev/null +++ b/apps/php8/versions/8.2.0/build/php/extensions/install-composer.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# 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, '7.2.5', '>');") + +if [ "$supportLatest" -eq "1" ]; then + curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \ + && chmod +x /usr/bin/composer +else + curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ + && php /tmp/composer-setup.php --install-dir=/tmp \ + && mv /tmp/composer.phar /usr/bin/composer \ + && chmod +x /usr/bin/composer \ + && rm -rf /tmp/composer-setup.php +fi \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/build/php/extensions/install-php-extensions b/apps/php8/versions/8.2.0/build/php/extensions/install-php-extensions new file mode 100644 index 00000000..72a75d9f --- /dev/null +++ b/apps/php8/versions/8.2.0/build/php/extensions/install-php-extensions @@ -0,0 +1,4093 @@ +#!/bin/sh + +# This script wraps docker-php-ext-install, properly configuring the system. +# +# Copyright (c) Michele Locati, 2018-2023 +# +# Source: https://github.com/mlocati/docker-php-extension-installer +# +# License: MIT - see https://github.com/mlocati/docker-php-extension-installer/blob/master/LICENSE + +# Let's set a sane environment +set -o errexit +set -o nounset + +if test "${IPE_DEBUG:-}" = "1"; then + set -x +fi + +if ! which docker-php-ext-configure >/dev/null || ! which docker-php-ext-enable >/dev/null || ! which docker-php-ext-install >/dev/null || ! which docker-php-source >/dev/null; then + printf 'The script %s is meant to be used with official Docker PHP Images - https://hub.docker.com/_/php\n' "$0" >&2 + exit 1 +fi + +IPE_VERSION=master + +StandWithUkraine() { + if test -t 1 && ! grep -Eq '^VERSION=.*jessie' /etc/os-release; then + printf '\e[37;44m#StandWith\e[30;43mUkraine\e[0m\n' + else + printf '#StandWithUkraine\n' + fi +} + +if test "$IPE_VERSION" = master && test "${CI:-}" != true; then + cat <&2 + exit 1 + fi + DISTRO="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)" + DISTRO_VERSION_NUMBER="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)" + DISTRO_VERSION="$(printf '%s@%s' $DISTRO $DISTRO_VERSION_NUMBER)" + DISTRO_MAJMIN_VERSION="$(echo "$DISTRO_VERSION_NUMBER" | awk -F. '{print $1*100+$2}')" +} + +# Set: +# - PHP_MAJMIN_VERSION: Major-Minor version, format MMmm (example 800 for PHP 8.0.1) +# - PHP_MAJDOTMIN_VERSION: Major-Minor version, format M.m (example 8.0 for PHP 8.0.1) +# - PHP_MAJMINPAT_VERSION: Major-Minor-Patch version, format MMmmpp (example 80001 for PHP 8.0.1) variables containing integers value +# - PHP_MAJDOTMINDOTPAT_VERSION: Major-Minor-Patch version, format M.m.p (example 8.0.1 for PHP 8.0.1) +# - PHP_THREADSAFE: 1 if PHP is thread-safe (TS), 0 if not thread-safe (NTS) +# - PHP_DEBUGBUILD: 1 if PHP is debug build (configured with "--enable-debug"), 0 otherwise +# - PHP_BITS: 32 if PHP is compiled for 32-bit, 64 if 64-bit +# - PHP_EXTDIR: the absolute path where the PHP extensions reside +setPHPVersionVariables() { + PHP_MAJDOTMINDOTPAT_VERSION="$(php-config --version)" + PHP_MAJMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*100+$2}') + PHP_MAJDOTMIN_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | cut -d. -f1-2) + PHP_MAJMINPAT_VERSION=$(printf '%s' "$PHP_MAJDOTMINDOTPAT_VERSION" | awk -F. '{print $1*10000+$2*100+$3}') + PHP_THREADSAFE=$(php -n -r 'echo ZEND_THREAD_SAFE ? 1 : 0;') + PHP_DEBUGBUILD=$(php -n -r 'echo ZEND_DEBUG_BUILD ? 1 : 0;') + PHP_BITS=$(php -n -r 'echo PHP_INT_SIZE * 8;') + PHP_EXTDIR="$(php -d display_errors=stderr -r 'echo realpath(ini_get("extension_dir"));')" +} + +# Fix apt-get being very slow on Debian Jessie +# See https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1332440 +fixMaxOpenFiles() { + fixMaxOpenFiles_cur=$(ulimit -n 2>/dev/null || echo 0) + if test "$fixMaxOpenFiles_cur" -gt 10000; then + ulimit -n 10000 + fi +} + +# Get the directory containing the compiled PHP extensions +# +# Output: +# The absolute path of the extensions dir +getPHPExtensionsDir() { + php -i | grep -E '^extension_dir' | head -n1 | tr -s '[:space:]*=>[:space:]*' '|' | cut -d'|' -f2 +} + +# Normalize the name of a PHP extension +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The normalized module name +normalizePHPModuleName() { + normalizePHPModuleName_name="$1" + case "$normalizePHPModuleName_name" in + *A* | *B* | *C* | *D* | *E* | *F* | *G* | *H* | *I* | *J* | *K* | *L* | *M* | *N* | *O* | *P* | *Q* | *R* | *S* | *T* | *U* | *V* | *W* | *X* | *Y* | *Z*) + normalizePHPModuleName_name="$(LC_CTYPE=C printf '%s' "$normalizePHPModuleName_name" | tr '[:upper:]' '[:lower:]')" + ;; + esac + case "$normalizePHPModuleName_name" in + datadog_trace) + normalizePHPModuleName_name=ddtrace + ;; + ioncube | ioncube\ loader) + normalizePHPModuleName_name='ioncube_loader' + ;; + pecl_http) + normalizePHPModuleName_name='http' + ;; + zend\ opcache) + normalizePHPModuleName_name='opcache' + ;; + libsodium) + if test $PHP_MAJMIN_VERSION -ge 700; then + normalizePHPModuleName_name='sodium' + fi + ;; + sodium) + if test $PHP_MAJMIN_VERSION -lt 700; then + normalizePHPModuleName_name='libsodium' + fi + ;; + *\ *) + printf '### WARNING Unrecognized module name: %s ###\n' "$1" >&2 + ;; + esac + printf '%s' "$normalizePHPModuleName_name" +} + +# Get the PECL name of PHP extension +# +# Arguments: +# $1: the name of the extension +# +# Output: +# The PECL name of the extension +getPeclModuleName() { + normalizePHPModuleName_name="$1" + case "$normalizePHPModuleName_name" in + ddtrace) + normalizePHPModuleName_name=datadog_trace + ;; + http) + normalizePHPModuleName_name=pecl_http + ;; + sodium) + normalizePHPModuleName_name=libsodium + ;; + esac + printf '%s' "$normalizePHPModuleName_name" +} + +# Parse a package.xml (or package2.xml) file and extract the module name and version +# +# Arguments: +# $1: the patho to the XML file +# +# Set these variables: +# - EXTRACTPACKAGEVERSIONFROMXML_NAME +# - EXTRACTPACKAGEVERSIONFROMXML_VERSION +# +# Output: +# Nothing +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +extractPackageVersionFromXML() { + if ! test -f "$1"; then + printf 'Unable to find the file\n%s\n' >&2 + return 1 + fi + extractPackageVersionFromXML_code="$( + cat <<'EOT' +$doc = new DOMDocument(); +if (!$doc->load($argv[1])) { + fwrite(STDERR, "Failed to load XML file\n"); + exit(1); +} +set_error_handler( + static function($errno, $errstr) { + fwrite(STDERR, trim((string) $errstr) . "\n"); + exit(1); + }, + -1 +); +$xpath = new DOMXpath($doc); +$xpath->registerNamespace('v20', 'http://pear.php.net/dtd/package-2.0'); +$xpath->registerNamespace('v21', 'http://pear.php.net/dtd/package-2.1'); +if ($xpath->query('/v20:package/v20:dependencies')->length === 1) { + $ns = 'v20:'; +} elseif ($xpath->query('/v21:package/v21:dependencies')->length === 1) { + $ns = 'v21:'; +} elseif ($xpath->query('/package')->length === 1) { + $ns = ''; +} else { + fwrite(STDERR, "Unsupported namespace of the XML of package version details\n"); +} +$nodes = $xpath->query("/{$ns}package/{$ns}name"); +$name = trim((string) $nodes[0]->nodeValue); +if ($ns === '') { + $nodes = $xpath->query("/{$ns}package/{$ns}version"); +} else { + $nodes = $xpath->query("/{$ns}package/{$ns}version/{$ns}release"); +} +$version = trim((string) $nodes[0]->nodeValue); +echo "EXTRACTPACKAGEVERSIONFROMXML_NAME='{$name}'\n"; +echo "EXTRACTPACKAGEVERSIONFROMXML_VERSION='{$version}'\n"; +exit(0); +EOT + )" + extractPackageVersionFromXML_vars="$(php -n -d display_errors=stderr -r "$extractPackageVersionFromXML_code" "$1")" + if test -z "$extractPackageVersionFromXML_vars"; then + return 1 + fi + eval "$extractPackageVersionFromXML_vars" + return 0 +} + +# Parse a module name (and optionally version) as received via command arguments, extracting the version and normalizing it +# Examples: +# xdebug-2.9.8 +# xdebug-^2 +# xdebug-^2.9 +# +# Arguments: +# $1: the name of the module to be normalized +# +# Set these variables: +# - PROCESSED_PHP_MODULE_ARGUMENT +# +# Optionally set these variables: +# - PHP_WANTEDMODULEVERSION_<...> (where <...> is the normalized module name) +# - PHP_MODULESOURCECODEPATH_<...> (where <...> is the normalized module name) +# +# Output: +# Nothing +processPHPModuleArgument() { + processPHPModuleArgument_arg="$1" + # Convert GitHub short form to long url, + # for example: from + # php-memcached-dev/php-memcached@8f106564e6bb005ca6100b12ccc89000daafa9d8 + # to + # https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/8f106564e6bb005ca6100b12ccc89000daafa9d8 + processPHPModuleArgument_arg="$(printf '%s' "$processPHPModuleArgument_arg" | sed -E 's/^([a-zA-Z0-9_.\-]+\/[a-zA-Z0-9_.\-]+)@(.+$)/https:\/\/codeload.github.com\/\1\/tar.gz\/\2/')" + # Let's check if $processPHPModuleArgument_arg is an URL + if printf '%s' "$processPHPModuleArgument_arg" | grep -Eq '^https?://[^ ]+/[^ ]+$'; then + printf 'Downloading source from %s\n' "$processPHPModuleArgument_arg" + processPHPModuleArgument_arg="$(getPackageSource "$processPHPModuleArgument_arg")" + fi + # Let's check if $processPHPModuleArgument_arg the absolute path of an existing directory + if test "$processPHPModuleArgument_arg" != "${processPHPModuleArgument_arg#/}" && test -d "$processPHPModuleArgument_arg"; then + if test -f "$processPHPModuleArgument_arg/package2.xml"; then + printf 'Checking package2.xml of directory %s... ' "$processPHPModuleArgument_arg" + if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package2.xml"; then + return 1 + fi + elif test -f "$processPHPModuleArgument_arg/package.xml"; then + printf 'Checking package.xml of directory %s... ' "$processPHPModuleArgument_arg" + if ! extractPackageVersionFromXML "$processPHPModuleArgument_arg/package.xml"; then + return 1 + fi + else + printf 'Unable to find the package.xml file in the directory\n%s\n' "$processPHPModuleArgument_arg" + return 1 + fi + printf 'good (name: %s, version: %s)\n' "$EXTRACTPACKAGEVERSIONFROMXML_NAME" "$EXTRACTPACKAGEVERSIONFROMXML_VERSION" + PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$EXTRACTPACKAGEVERSIONFROMXML_NAME")" + processPHPModuleArgument_version="$EXTRACTPACKAGEVERSIONFROMXML_VERSION" + if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval PHP_MODULESOURCECODEPATH_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_arg" + else + printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2 + exit 1 + fi + else + PROCESSED_PHP_MODULE_ARGUMENT="${processPHPModuleArgument_arg%%-*}" + if test -n "$PROCESSED_PHP_MODULE_ARGUMENT" && test "$PROCESSED_PHP_MODULE_ARGUMENT" != "$processPHPModuleArgument_arg"; then + processPHPModuleArgument_version="${processPHPModuleArgument_arg#*-}" + else + processPHPModuleArgument_version='' + fi + PROCESSED_PHP_MODULE_ARGUMENT="$(normalizePHPModuleName "$PROCESSED_PHP_MODULE_ARGUMENT")" + fi + if test -n "$processPHPModuleArgument_version"; then + if printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval PHP_WANTEDMODULEVERSION_$PROCESSED_PHP_MODULE_ARGUMENT="$processPHPModuleArgument_version" + elif printf '%s' "$PROCESSED_PHP_MODULE_ARGUMENT" | grep -Eq '^@[a-zA-Z0-9_]+$'; then + eval PHP_WANTEDMODULEVERSION__${PROCESSED_PHP_MODULE_ARGUMENT#@}="$processPHPModuleArgument_version" + else + printf 'Unable to parse the following module name:\n%s\n' "$PROCESSED_PHP_MODULE_ARGUMENT" >&2 + fi + fi +} + +# Get the wanted PHP module version, as specified in the command line arguments. +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The wanted version (if any) +getWantedPHPModuleVersion() { + if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_WANTEDMODULEVERSION_$1:-}" + elif printf '%s' "$1" | grep -Eq '^@[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_WANTEDMODULEVERSION__${1#@}:-}" + fi +} + +# Get source code path of a PHP module version, as specified in the command line arguments. +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The wanted version (if any) +getModuleSourceCodePath() { + if printf '%s' "$1" | grep -Eq '^[a-zA-Z0-9_]+$'; then + eval printf '%s' "\${PHP_MODULESOURCECODEPATH_$1:-}" + fi +} + +# Get the wanted PHP module version, resolving it if it starts with '^' +# +# Arguments: +# $1: the name of the module to be normalized +# +# Output: +# The version to be used +resolveWantedPHPModuleVersion() { + resolveWantedPHPModuleVersion_raw="$(getWantedPHPModuleVersion "$1")" + resolveWantedPHPModuleVersion_afterCaret="${resolveWantedPHPModuleVersion_raw#^}" + if test "$resolveWantedPHPModuleVersion_raw" = "$resolveWantedPHPModuleVersion_afterCaret"; then + printf '%s' "$resolveWantedPHPModuleVersion_raw" + return + fi + resolveWantedPHPModuleVersion_xml="$(curl -sSLf "http://pecl.php.net/rest/r/$1/allreleases.xml")" + resolveWantedPHPModuleVersion_versions="$(printf '%s' "$resolveWantedPHPModuleVersion_xml" | tr -s ' \t\r\n' ' ' | sed -r 's# *<#\n<#g' | grep '' | sed 's###g' | sed 's# ##g')" + resetIFS + for resolveWantedPHPModuleVersion_version in $resolveWantedPHPModuleVersion_versions; do + resolveWantedPHPModuleVersion_suffix="${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret}" + if test "$resolveWantedPHPModuleVersion_version" != "${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret.}"; then + # Example: looking for 1.0, found 1.0.1 + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + fi + done + for resolveWantedPHPModuleVersion_version in $resolveWantedPHPModuleVersion_versions; do + resolveWantedPHPModuleVersion_suffix="${resolveWantedPHPModuleVersion_version#$resolveWantedPHPModuleVersion_afterCaret}" + if test "$resolveWantedPHPModuleVersion_version" = "$resolveWantedPHPModuleVersion_suffix"; then + continue + fi + if test -z "$resolveWantedPHPModuleVersion_suffix"; then + # Example: looking for 1.0, found exactly it + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + fi + case "$resolveWantedPHPModuleVersion_suffix" in + [0-9]) + # Example: looking for 1.1, but this is 1.10 + ;; + *) + # Example: looking for 1.1, this is 1.1rc1 + printf '%s' "$resolveWantedPHPModuleVersion_version" + return + ;; + esac + done + printf 'Unable to find a version of "%s" compatible with "%s"\nAvailable versions are:\n%s\n' "$1" "$resolveWantedPHPModuleVersion_raw" "$resolveWantedPHPModuleVersion_versions" >&2 + exit 1 +} + +# Get the actual version of a PECL pmodule, resolving 'latest', 'stable', 'beta', 'alpha', 'devel'. +# +# Arguments: +# $1: the module name as known on the PECL archive +# $2: the version to be resolved +# Output: +# $2 itself if $1 is not 'latest', 'stable', 'beta', 'alpha', or 'devel', the actual version otherwise +resolvePeclStabilityVersion() { + case "$2" in + latest | stable | beta | alpha | devel) ;; + *) + printf '%s' "$2" + return + ;; + esac + peclStabilityFlagToVersion_url="http://pecl.php.net/rest/r/$1/$2.txt" + if ! peclStabilityFlagToVersion_result="$(curl -sSLf "$peclStabilityFlagToVersion_url")"; then + peclStabilityFlagToVersion_result='' + fi + if test -z "$peclStabilityFlagToVersion_result"; then + printf 'Failed to resolve the PECL package version "%s" of %s from %s\n' "$2" "$1" "$peclStabilityFlagToVersion_url" >&2 + exit 1 + fi + printf '%s' "$peclStabilityFlagToVersion_result" +} + +# Set these variables: +# - PHP_PREINSTALLED_MODULES the normalized list of PHP modules installed before running this script +setPHPPreinstalledModules() { + PHP_PREINSTALLED_MODULES='' + IFS=' +' + for getPHPInstalledModules_module in $(php -m); do + getPHPInstalledModules_moduleNormalized='' + case "$getPHPInstalledModules_module" in + \[PHP\ Modules\]) ;; + \[Zend\ Modules\]) + break + ;; + *) + getPHPInstalledModules_moduleNormalized="$(normalizePHPModuleName "$getPHPInstalledModules_module")" + if ! stringInList "$getPHPInstalledModules_moduleNormalized" "$PHP_PREINSTALLED_MODULES"; then + PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES $getPHPInstalledModules_moduleNormalized" + fi + ;; + esac + done + if command -v composer >/dev/null; then + PHP_PREINSTALLED_MODULES="$PHP_PREINSTALLED_MODULES @composer" + fi + resetIFS + PHP_PREINSTALLED_MODULES="${PHP_PREINSTALLED_MODULES# }" +} + +# Get the handles of the modules to be installed +# +# Arguments: +# $@: all module handles +# +# Set: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +processCommandArguments() { + processCommandArguments_endArgs=0 + PHP_MODULES_TO_INSTALL='' + # Support deprecated flag IPE_FIX_CACERTS + case "${IPE_FIX_CACERTS:-}" in + 1 | y* | Y*) + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL @fix_letsencrypt" + ;; + esac + while :; do + if test $# -lt 1; then + break + fi + processCommandArguments_skip=0 + if test $processCommandArguments_endArgs -eq 0; then + case "$1" in + --cleanup) + printf '### WARNING the %s option is deprecated (we always cleanup everything) ###\n' "$1" >&2 + processCommandArguments_skip=1 + ;; + --) + processCommandArguments_skip=1 + processCommandArguments_endArgs=1 + ;; + -*) + printf 'Unrecognized option: %s\n' "$1" >&2 + exit 1 + ;; + esac + fi + if test $processCommandArguments_skip -eq 0; then + processPHPModuleArgument "$1" + processCommandArguments_name="$PROCESSED_PHP_MODULE_ARGUMENT" + if stringInList "$processCommandArguments_name" "$PHP_MODULES_TO_INSTALL"; then + printf '### WARNING Duplicated module name specified: %s ###\n' "$processCommandArguments_name" >&2 + elif stringInList "$processCommandArguments_name" "$PHP_PREINSTALLED_MODULES"; then + printf '### WARNING Module already installed: %s ###\n' "$processCommandArguments_name" >&2 + else + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $processCommandArguments_name" + fi + fi + shift + done + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }" +} + +# Add a module that's required by another module +# +# Arguments: +# $1: module that requires another module +# $2: the required module +# +# Update: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +checkRequiredModule() { + if ! stringInList "$1" "$PHP_MODULES_TO_INSTALL"; then + return + fi + if stringInList "$2" "$PHP_PREINSTALLED_MODULES"; then + return + fi + PHP_MODULES_TO_INSTALL="$(removeStringFromList "$1" "$PHP_MODULES_TO_INSTALL")" + if ! stringInList "$2" "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $2" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL# }" + fi + PHP_MODULES_TO_INSTALL="$PHP_MODULES_TO_INSTALL $1" +} + +# Sort the modules to be installed, in order to fix dependencies +# +# Update: +# PHP_MODULES_TO_INSTALL +# +# Output: +# Nothing +sortModulesToInstall() { + # apcu_bc requires apcu + checkRequiredModule 'apcu_bc' 'apcu' + # http requires propro (for PHP < 8) and raphf + if test $PHP_MAJMIN_VERSION -le 704; then + checkRequiredModule 'http' 'propro' + fi + checkRequiredModule 'http' 'raphf' + # event requires sockets (for PHP <= 5.6) + if test $PHP_MAJMIN_VERSION -le 506; then + checkRequiredModule event sockets + fi + # relay requires msgpack + checkRequiredModule relay msgpack + # relay requires igbinary + checkRequiredModule relay igbinary + # Some module installation may use sockets if available: move it before other modules + if stringInList 'sockets' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'sockets' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="sockets $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use igbinary if available: move it before other modules + if stringInList 'igbinary' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'igbinary' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="igbinary $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use msgpack if available: move it before other modules + if stringInList 'msgpack' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'msgpack' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="msgpack $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use socket if available: move it before other modules + if stringInList 'socket' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'socket' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="socket $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # Some module installation may use apcu if available: move it before other modules + if stringInList 'apcu' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList 'apcu' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="apcu $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi + # In any case, first of all, we need to install composer + if stringInList '@composer' "$PHP_MODULES_TO_INSTALL"; then + PHP_MODULES_TO_INSTALL="$(removeStringFromList '@composer' "$PHP_MODULES_TO_INSTALL")" + PHP_MODULES_TO_INSTALL="@composer $PHP_MODULES_TO_INSTALL" + PHP_MODULES_TO_INSTALL="${PHP_MODULES_TO_INSTALL% }" + fi +} + +# Expand the IPE_ASPELL_LANGUAGES environment variable into apk/apt package names +expandASpellDictionaries() { + expandASpellDictionaries_languages="${IPE_ASPELL_LANGUAGES:-en}" + expandASpellDictionaries_result='' + resetIFS + for expandASpellDictionaries_language in $expandASpellDictionaries_languages; do + expandASpellDictionaries_result="$expandASpellDictionaries_result aspell-$expandASpellDictionaries_language" + done + printf '%s' "${expandASpellDictionaries_result# }" +} + +# Get the required APT/APK packages for a specific PHP version and for the list of module handles +# +# Arguments: +# $@: the PHP module handles +# +# Set: +# PACKAGES_PERSISTENT_NEW the list of packages required at runtume that must be installed +# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed +# PACKAGES_VOLATILE the list of packages required at compile time that must be installed +# PACKAGES_PREVIOUS the list of packages (with their version) that are installed right now (calculated only on Debian and only if PACKAGES_PERSISTENT_NEW or PACKAGES_VOLATILE are not empty) +buildRequiredPackageLists() { + buildRequiredPackageLists_persistent='' + buildRequiredPackageLists_volatile='' + case "$DISTRO" in + alpine) + apk update + ;; + debian) + invokeAptGetUpdate + ;; + esac + case "$DISTRO_VERSION" in + alpine@*) + if test $# -gt 1 || test "${1:-}" != '@composer'; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $PHPIZE_DEPS" + fi + if test -z "$(apk info 2>/dev/null | grep -E ^libssl)"; then + buildRequiredPackageLists_libssl='libssl1.0' + elif test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libtls')" && test -z "$(apk info 2>/dev/null | grep -E '^libressl.*-libssl')" && test -z "$(apk info 2>/dev/null | grep -E '^libretls-')"; then + buildRequiredPackageLists_libssl=$(apk search -q libressl*-libtls) + else + buildRequiredPackageLists_libssl='' + fi + if test $DISTRO_MAJMIN_VERSION -le 313; then + buildRequiredPackageLists_libssldev='libressl-dev' + else + buildRequiredPackageLists_libssldev='libretls-dev' + fi + buildRequiredPackageLists_icuPersistent='' + if test $DISTRO_MAJMIN_VERSION -ge 316; then + case "${IPE_ICU_EN_ONLY:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_icuPersistent='icu-data-full' + ;; + esac + fi + ;; + debian@9) + buildRequiredPackageLists_libssldev='libssl1.0-dev' + ;; + debian@*) + buildRequiredPackageLists_libssldev='^libssl([0-9]+(\.[0-9]+)*)?-dev$' + ;; + esac + if test $USE_PICKLE -gt 1; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git" + fi + while :; do + if test $# -lt 1; then + break + fi + case "$1@$DISTRO" in + @composer@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unzip" + ;; + amqp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent rabbitmq-c" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile rabbitmq-c-dev" + ;; + amqp@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librabbitmq[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librabbitmq-dev libssh-dev" + ;; + bz2@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libbz2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile bzip2-dev" + ;; + bz2@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libbz2-dev" + ;; + cassandra@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent cassandra-cpp-driver gmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cassandra-cpp-driver-dev gmp-dev" + ;; + cmark@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + ;; + cmark@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake" + ;; + ddtrace@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev" + ;; + ddtrace@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent curl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-openssl-dev" + ;; + dba@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent db" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile db-dev" + ;; + dba@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libdb5\.3-dev$" + if test $PHP_MAJMIN_VERSION -le 505; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile patch" + fi + ;; + decimal@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev" + ;; + enchant@alpine) + if test $DISTRO_MAJMIN_VERSION -ge 312; then + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" + else + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + fi + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant-dev" + fi + ;; + enchant@debian) + if test $DISTRO_VERSION_NUMBER -ge 11; then + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" + else + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-en libhunspell-1.7-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libglib2.0-dev libaspell-dev libhunspell-dev" + fi + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-dev" + fi + ;; + event@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev" + ;; + event@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libevent[0-9\.\-]*$ ^libevent-openssl[0-9\.\-]*$ ^libevent-extra[0-9\.\-]*$ ^libevent-pthreads[0-9\.\-]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libevent-dev $buildRequiredPackageLists_libssldev" + ;; + ffi@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libffi" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev" + ;; + ffi@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libffi-dev" + ;; + gd@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetype libjpeg-turbo libpng libxpm" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetype-dev libjpeg-turbo-dev libpng-dev libxpm-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvpx" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + if test $DISTRO_MAJMIN_VERSION -ge 315; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libavif aom-libs libdav1d" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev aom-dev dav1d-dev" + elif isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + else + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson" + ;; + esac + fi + fi + fi + ;; + gd@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libvpx[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvpx-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libwebp[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" + if test $PHP_MAJMIN_VERSION -ge 801; then + if ! isLibaomInstalled || ! isLibdav1dInstalled || ! isLibyuvInstalled || ! isLibavifInstalled; then + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson" + ;; + esac + fi + fi + fi + ;; + gearman@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ libuuid" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile boost-dev gperf libmemcached-dev libevent-dev util-linux-dev" + ;; + gearman@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgearman[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgearman-dev" + ;; + geoip@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geoip" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geoip-dev" + ;; + geoip@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeoip1[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeoip-dev" + ;; + geos@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent geos-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile geos" + ;; + geos@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgeos-c1(v[0-9]*)?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgeos-dev" + ;; + gettext@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libintl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gettext-dev" + ;; + gmagick@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent graphicsmagick libgomp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile graphicsmagick-dev libtool" + ;; + gmagick@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgraphicsmagick(-q16-)?[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgraphicsmagick1-dev" + ;; + gmp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gmp-dev" + ;; + gmp@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgmp-dev" + ;; + gnupg@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gpgme" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gpgme-dev" + ;; + gnupg@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libgpgme[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libgpgme[0-9]*-dev$" + ;; + grpc@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev linux-headers" + ;; + grpc@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + http@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libevent" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev curl-dev libevent-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libidn" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libidn-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libidn" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev libidn-dev" + fi + ;; + http@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls ^libevent[0-9\.\-]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev libgnutls28-dev libcurl4-gnutls-dev libevent-dev" + if test $PHP_MAJMIN_VERSION -le 506; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile ^libidn1[0-9+]-dev$" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$ ^libidn2-[0-9+]$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev ^libidn2-[0-9+]-dev$" + fi + ;; + imagick@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent imagemagick libgomp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile imagemagick-dev" + ;; + imagick@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmagickwand-6.q16-[0-9]+$ ^libmagickcore-6.q16-[0-9]+-extra$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmagickwand-dev" + ;; + imap@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-client $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile krb5-dev imap-dev $buildRequiredPackageLists_libssldev" + ;; + imap@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-client2007e" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libkrb5-dev" + case "$DISTRO_VERSION" in + debian@9) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev comerr-dev krb5-multidev libc-client2007e libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-8 libpam0g-dev libssl-doc mlock" + ;; + *) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-client-dev" + ;; + esac + ;; + interbase@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + ;; + interbase@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util" + ;; + intl@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev" + ;; + intl@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libicu[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev" + ;; + ion@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake git" + ;; + ion@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake git" + ;; + ldap@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libldap" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile openldap-dev" + ;; + ldap@debian) + if test $DISTRO_VERSION_NUMBER -ge 9; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libldap-common" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libldap2-dev" + ;; + luasandbox@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lua5.1-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lua5.1-dev" + ;; + luasandbox@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblua5.1-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblua5.1-0-dev" + ;; + lz4@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lz4-dev" + ;; + lz4@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblz4-1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblz4-dev" + ;; + maxminddb@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmaxminddb" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmaxminddb-dev" + ;; + maxminddb@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmaxminddb[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmaxminddb-dev" + ;; + memprof@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent judy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile judy-dev bsd-compat-headers" + ;; + memprof@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libjudydebian1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libjudy-dev" + ;; + mcrypt@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmcrypt" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmcrypt-dev" + ;; + mcrypt@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmcrypt4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmcrypt-dev" + ;; + memcache@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + memcache@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + memcached@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmemcached-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmemcached-dev zlib-dev" + ;; + memcached@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmemcachedutil2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmemcached-dev zlib1g-dev" + ;; + mongo@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsasl $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev cyrus-sasl-dev" + ;; + mongo@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libsasl2-dev" + ;; + mongodb@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libsasl $buildRequiredPackageLists_libssl snappy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev cyrus-sasl-dev snappy-dev $buildRequiredPackageLists_libssldev zlib-dev" + ;; + mongodb@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsnappy[0-9]+(v[0-9]+)?$ ^libicu[0-9]+$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev libsasl2-dev libsnappy-dev $buildRequiredPackageLists_libssldev zlib1g-dev" + ;; + mosquitto@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent mosquitto-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile mosquitto-dev" + ;; + mosquitto@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libmosquitto1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmosquitto-dev" + ;; + mssql@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + mssql@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsybdb5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + oauth@alpine) + if test $PHP_MAJMIN_VERSION -ge 700; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev" + fi + ;; + oauth@debian) + if test $PHP_MAJMIN_VERSION -ge 700; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev" + fi + ;; + oci8@alpine | pdo_oci@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libaio libc6-compat libnsl" + if test $DISTRO_MAJMIN_VERSION -le 307; then + # The unzip tool of Alpine 3.7 can't extract symlinks from ZIP archives: let's use bsdtar instead + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libarchive-tools" + fi + ;; + oci8@debian | pdo_oci@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libaio[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unzip" + ;; + odbc@alpine | pdo_odbc@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + odbc@debian | pdo_odbc@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libodbc1" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + openswoole@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + ;; + openswoole@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + ;; + parle@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + pdo_dblib@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + pdo_dblib@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsybdb5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + pdo_firebird@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev ncurses-dev" + ;; + pdo_firebird@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libfbclient2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util" + ;; + pgsql@alpine | pdo_pgsql@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile postgresql-dev" + ;; + pgsql@debian | pdo_pgsql@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpq-dev" + ;; + php_trie@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + pspell@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-libs $(expandASpellDictionaries)" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile aspell-dev" + ;; + pspell@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libaspell15 $(expandASpellDictionaries)" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpspell-dev" + ;; + rdkafka@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librdkafka" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev" + ;; + rdkafka@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^librdkafka\+*[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librdkafka-dev" + ;; + recode@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent recode" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile recode-dev" + ;; + recode@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent librecode0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile librecode-dev" + ;; + redis@alpine) + if test $PHP_MAJMIN_VERSION -ge 700; then + case "$DISTRO_VERSION" in + alpine@3.7) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd" + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zstd-libs" + ;; + esac + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zstd-dev" + fi + ;; + redis@debian) + if test $PHP_MAJMIN_VERSION -ge 700; then + case "$DISTRO_VERSION" in + debian@8) + ## There's no APT package for libzstd + ;; + debian@9) + ## libzstd is too old (available: 1.1.2, required: 1.3.0+) + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzstd[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzstd-dev" + ;; + esac + fi + ;; + relay@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lz4-libs zstd-libs" + if test $DISTRO_MAJMIN_VERSION -ge 317; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.1" + fi + ;; + simdjson@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + ;; + smbclient@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsmbclient" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile samba-dev" + ;; + smbclient@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsmbclient" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsmbclient-dev" + ;; + snappy@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent snappy" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile snappy-dev" + ;; + snappy@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsnappy1(v[0-9]+)?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsnappy-dev" + ;; + snmp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent net-snmp-libs" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile net-snmp-dev" + ;; + snmp@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent snmp" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsnmp-dev" + ;; + snuffleupagus@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent pcre" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev" + ;; + snuffleupagus@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev" + ;; + soap@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + soap@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + sockets@alpine) + if test $PHP_MAJMIN_VERSION -ge 802; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + fi + ;; + sodium@alpine | libsodium@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsodium" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev" + ;; + sodium@debian | libsodium@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsodium[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev" + ;; + solr@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev libxml2-dev" + ;; + solr@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-gnutls-dev libxml2-dev" + ;; + spx@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + spx@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + sqlsrv@alpine | pdo_sqlsrv@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + ;; + sqlsrv@debian | pdo_sqlsrv@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent unixodbc" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile unixodbc-dev" + if ! isMicrosoftSqlServerODBCInstalled; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile gnupg apt-transport-https" + fi + ;; + ssh2@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssh2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-dev" + ;; + ssh2@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssh2-1-dev" + ;; + stomp@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev" + ;; + stomp@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev" + ;; + swoole@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent postgresql-libs libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev postgresql-dev linux-headers $buildRequiredPackageLists_libssldev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent c-ares" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile c-ares-dev" + fi + ;; + swoole@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libcurl4-gnutls-dev libpq-dev" + if test $PHP_MAJMIN_VERSION -ge 702; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libc-ares2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libc-ares-dev" + fi + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + fi + ;; + sybase_ct@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + sybase_ct@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libct4" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile freetds-dev" + ;; + tdlib@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++ $buildRequiredPackageLists_libssl" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git cmake gperf zlib-dev $buildRequiredPackageLists_libssldev linux-headers readline-dev" + ;; + tdlib@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile git cmake gperf zlib1g-dev $buildRequiredPackageLists_libssldev" + ;; + tensor@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent lapack libexecinfo openblas" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile lapack-dev libexecinfo-dev openblas-dev" + if test $DISTRO_MAJMIN_VERSION -le 310; then + if ! stringInList --force-overwrite "$IPE_APK_FLAGS"; then + IPE_APK_FLAGS="$IPE_APK_FLAGS --force-overwrite" + fi + fi + ;; + tensor@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liblapacke libopenblas-base" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liblapack-dev libopenblas-dev liblapacke-dev" + if test $DISTRO_VERSION_NUMBER -ge 11; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gfortran-10" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgfortran-10-dev" + elif test $DISTRO_VERSION_NUMBER -ge 10; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent gfortran-8" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libgfortran-8-dev" + fi + ;; + tidy@alpine) + if test $DISTRO_MAJMIN_VERSION -ge 315; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent tidyhtml" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent tidyhtml-libs" + fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile tidyhtml-dev" + ;; + tidy@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libtidy-?[0-9][0-9.\-]*(deb[0-9])?$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libtidy-dev" + ;; + uuid@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libuuid" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile util-linux-dev" + ;; + uuid@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile uuid-dev" + ;; + vips@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent vips" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile vips-dev" + ;; + vips@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libvips" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libvips-dev" + ;; + wddx@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + wddx@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xdebug@alpine) + if test $PHP_MAJMIN_VERSION -ge 800; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile linux-headers" + fi + ;; + xlswriter@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib-dev" + ;; + xlswriter@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile zlib1g-dev" + ;; + xmldiff@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmldiff@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmlrpc@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xmlrpc@debian) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" + ;; + xsl@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libxslt" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev libgcrypt-dev" + ;; + xsl@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libxslt1\.1$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxslt-dev" + ;; + yaml@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent yaml" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile yaml-dev" + ;; + yaml@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libyaml-0-2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libyaml-dev" + ;; + yar@alpine) + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev" + ;; + yar@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-gnutls-dev" + ;; + zip@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libzip-dev $buildRequiredPackageLists_libssldev zlib-dev" + ;; + zip@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libzip[0-9]$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev $buildRequiredPackageLists_libssldev libzip-dev libbz2-dev zlib1g-dev" + case "$DISTRO_VERSION" in + debian@8) + # Debian Jessie doesn't seem to provide libmbedtls + ;; + *) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmbedtls[0-9]*$" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmbedtls-dev" + ;; + esac + ;; + zmq@alpine) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent zeromq-dev" + ;; + zmq@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzmq3-dev" + ;; + zookeeper@alpine) + if ! test -f /usr/local/include/zookeeper/zookeeper.h; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile maven automake libtool openjdk8" + fi + ;; + zookeeper@debian) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzookeeper-mt2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libzookeeper-mt-dev" + ;; + esac + shift + done + PACKAGES_PERSISTENT_NEW='' + PACKAGES_PERSISTENT_PRE='' + PACKAGES_VOLATILE='' + PACKAGES_PREVIOUS='' + if test -z "$buildRequiredPackageLists_persistent$buildRequiredPackageLists_volatile"; then + return + fi + if test -n "$buildRequiredPackageLists_persistent"; then + PACKAGES_PERSISTENT_NEW="$(expandPackagesToBeInstalled $buildRequiredPackageLists_persistent)" + if test -s "$IPE_ERRFLAG_FILE"; then + exit 1 + fi + resetIFS + for buildRequiredPackageLists_package in $buildRequiredPackageLists_persistent; do + buildRequiredPackageLists_package="$(expandInstalledSystemPackageName "$buildRequiredPackageLists_package")" + if test -n "$buildRequiredPackageLists_package"; then + PACKAGES_PERSISTENT_PRE="$PACKAGES_PERSISTENT_PRE $buildRequiredPackageLists_package" + fi + done + PACKAGES_PERSISTENT_PRE="${PACKAGES_PERSISTENT_PRE# }" + fi + if test -n "$buildRequiredPackageLists_volatile"; then + buildRequiredPackageLists_packages="$(expandPackagesToBeInstalled $buildRequiredPackageLists_volatile)" + if test -s "$IPE_ERRFLAG_FILE"; then + exit 1 + fi + resetIFS + for buildRequiredPackageLists_package in $buildRequiredPackageLists_packages; do + if ! stringInList "$buildRequiredPackageLists_package" "$PACKAGES_PERSISTENT_NEW"; then + if test "$buildRequiredPackageLists_package" != icu-data-en || ! stringInList icu-data-full "$PACKAGES_PERSISTENT_NEW"; then + PACKAGES_VOLATILE="$PACKAGES_VOLATILE $buildRequiredPackageLists_package" + fi + fi + done + PACKAGES_VOLATILE="${PACKAGES_VOLATILE# }" + fi + if test -n "$PACKAGES_PERSISTENT_NEW$PACKAGES_VOLATILE"; then + case "$DISTRO" in + debian) + PACKAGES_PREVIOUS="$(dpkg --get-selections | grep -E '\sinstall$' | awk '{ print $1 }')" + ;; + esac + fi +} + +# Get the full list of APT/APK packages that will be installed, given the required packages +# +# Arguments: +# $1: the list of required APT/APK packages +# +# Output: +# Space-separated list of every APT/APK packages that will be installed +expandPackagesToBeInstalled() { + expandPackagesToBeInstalled_result='' + case "$DISTRO" in + alpine) + expandPackagesToBeInstalled_log="$(apk add --simulate $@ 2>&1 || printf '\nERROR: apk failed\n')" + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^ERROR:')"; then + printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 + printf '%s ' "$@" >&2 + printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2 + echo 'y' >"$IPE_ERRFLAG_FILE" + exit 1 + fi + IFS=' +' + for expandPackagesToBeInstalled_line in $expandPackagesToBeInstalled_log; do + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_line" | grep -E '^\([0-9]*/[0-9]*) Installing ')"; then + expandPackagesToBeInstalled_result="$expandPackagesToBeInstalled_result $(printf '%s' "$expandPackagesToBeInstalled_line" | cut -d ' ' -f 3)" + fi + done + resetIFS + ;; + debian) + expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then + printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 + printf '%s ' "$@" >&2 + printf '\n\nCOMMAND OUTPUT:\n%s\n' "$expandPackagesToBeInstalled_log" >&2 + echo 'y' >"$IPE_ERRFLAG_FILE" + exit 1 + fi + expandPackagesToBeInstalled_inNewPackages=0 + IFS=' +' + for expandPackagesToBeInstalled_line in $expandPackagesToBeInstalled_log; do + if test $expandPackagesToBeInstalled_inNewPackages -eq 0; then + if test "$expandPackagesToBeInstalled_line" = 'The following NEW packages will be installed:'; then + expandPackagesToBeInstalled_inNewPackages=1 + fi + elif test "$expandPackagesToBeInstalled_line" = "${expandPackagesToBeInstalled_line# }"; then + break + else + resetIFS + for expandPackagesToBeInstalled_newPackage in $expandPackagesToBeInstalled_line; do + expandPackagesToBeInstalled_result="$expandPackagesToBeInstalled_result $expandPackagesToBeInstalled_newPackage" + done + IFS=' +' + fi + done + resetIFS + ;; + esac + printf '%s' "${expandPackagesToBeInstalled_result# }" +} + +# Check if a system package is installed; if so we prints its name. +# +# Arguments: +# $1: the name of the package to be checked (regular expressions accepted: they must start with a ^) +expandInstalledSystemPackageName() { + if test "$1" = "${1#^}"; then + expandInstalledSystemPackageName_grepflags='-Fx' + else + expandInstalledSystemPackageName_grepflags='-E' + fi + case "$DISTRO" in + alpine) + apk info | grep $expandInstalledSystemPackageName_grepflags -- "$1" || test $? -eq 1 + ;; + debian) + dpkg --get-selections | grep -E '\sinstall$' | awk '{ print $1 }' | cut -d: -f1 | grep $expandInstalledSystemPackageName_grepflags -- "$1" || test $? -eq 1 + ;; + esac +} + +# Retrieve the number of available cores (alternative to nproc if not available) +# +# Output: +# The number of processor cores available +getProcessorCount() { + if command -v nproc >/dev/null 2>&1; then + nproc + else + getProcessorCount_tmp=$(cat /proc/cpuinfo | grep -E '^processor\s*:\s*\d+$' | wc -l) + if test $getProcessorCount_tmp -ge 1; then + echo $getProcessorCount_tmp + else + echo 1 + fi + fi +} + +# Set these variables: +# - TARGET_TRIPLET the build target tripled (eg 'x86_64-linux-gnu', 'x86_64-alpine-linux-musl') +setTargetTriplet() { + TARGET_TRIPLET="$(gcc -print-multiarch 2>/dev/null || true)" + if test -z "$TARGET_TRIPLET"; then + TARGET_TRIPLET="$(gcc -dumpmachine)" + fi +} + +# Retrieve the number of processors to be used when compiling an extension +# +# Arguments: +# $1: the handle of the PHP extension to be compiled +# Output: +# The number of processors to be used +getCompilationProcessorCount() { + case "$1" in + '') + # The above extensions don't support parallel compilation + echo 1 + ;; + *) + # All the other extensions support parallel compilation + getProcessorCount + ;; + esac +} + +# Get the full path of a PHP extension given its name. +# +# Arguments: +# $1: the name of the PHP extension +# +# Output: +# The absolute path of the PHP extension file (or nothing if the file can't be found) +getModuleFullPath() { + case "$1" in + apcu_bc) + getModuleFullPath_path="$PHP_EXTDIR/apc.so" + ;; + *) + getModuleFullPath_path="$PHP_EXTDIR/$1.so" + ;; + esac + if ! test -f "$getModuleFullPath_path"; then + printf 'Unable to find the file of the PHP extension "%s"\n' "$1" >&2 + exit 1 + fi + printf '%s' "$getModuleFullPath_path" +} + +# Post-process a PHP module just compiled and installed in the PHP extension directory +# +# Arguments: +# $1: the name of the PHP extension +# +# Return: +# 0 (true): if suceeded +# non-zero (false): in case of errors +postProcessModule() { + postProcessModule_file="$(getModuleFullPath "$1")" + if test $PHP_DEBUGBUILD -ne 1; then + printf 'Removing symbols from %s... ' "$postProcessModule_file" + postProcessModule_preSize="$(stat -c %s "$postProcessModule_file")" + strip --strip-all "$postProcessModule_file" + postProcessModule_postSize="$(stat -c %s "$postProcessModule_file")" + printf 'done (%s bytes saved).\n' "$((postProcessModule_preSize - postProcessModule_postSize))" + fi + return $? +} + +# Get the type of the php.ini entry to be used for a PHP extension +# +# Arguments: +# $1: the name of the PHP extension +# +# Output: +# zend_extension or extension +getModuleIniEntryType() { + case "$1" in + ioncube_loader | sourceguardian) + # On PHP 5.5, docker-php-ext-enable fails to detect that ionCube Loader and sourceguardian are Zend extensions + if test $PHP_MAJMIN_VERSION -le 505; then + printf 'zend_extension' + return 0 + fi + ;; + esac + getModuleIniEntryType_file="$(getModuleFullPath "$1")" + if readelf --wide --syms "$getModuleIniEntryType_file" | grep -Eq ' zend_extension_entry$'; then + printf 'zend_extension' + else + printf 'extension' + fi +} + +# Create the contents of a PHP ini file that enables an extension +# +# Arguments: +# $1: the name of the PHP extension +# $2: additional php.ini configuration (optional) +# +# Output: +# The contents of the ini file +buildPhpExtensionIniContent() { + buildPhpExtensionIniContent_type="$(getModuleIniEntryType "$1")" + buildPhpExtensionIniContent_soFile="$(getModuleFullPath "$1")" + buildPhpExtensionIniContent_result="$(printf '%s=%s' "$buildPhpExtensionIniContent_type" "${buildPhpExtensionIniContent_soFile##$PHP_EXTDIR/}")" + if test -n "${2:-}"; then + buildPhpExtensionIniContent_result="$(printf '%s\n%s' "$buildPhpExtensionIniContent_result" "$2")" + fi + printf '%s' "$buildPhpExtensionIniContent_result" +} + +# Check that a PHP module actually works (better to run this check before enabling the extension) +# +# Arguments: +# $1: the name of the PHP extension +# $2: base name (without path and extension) of additional php.ini configuration (optional) +# $3: additional php.ini configuration (optional) +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +checkModuleWorking() { + if test -n "${2:-}"; then + checkModuleWorking_iniFile="$PHP_INI_DIR/conf.d/$2--temp.ini" + else + checkModuleWorking_iniFile="$PHP_INI_DIR/conf.d/docker-php-ext-$1--temp.ini" + fi + checkModuleWorking_iniContent="$(buildPhpExtensionIniContent "$1" "${3:-}")" + printf 'Check if the %s module can be loaded... ' "$1" + checkModuleWorking_errBefore="$(php -r 'return;' 2>&1 || true)" + printf '%s' "$checkModuleWorking_iniContent" >"$checkModuleWorking_iniFile" + checkModuleWorking_errAfter="$(php -r 'return;' 2>&1 || true)" + rm "$checkModuleWorking_iniFile" + if test "$checkModuleWorking_errAfter" != "$checkModuleWorking_errBefore"; then + printf 'Error loading the "%s" extension:\n%s\n' "$1" "$checkModuleWorking_errAfter" >&2 + return 1 + fi + printf 'ok.\n' + return 0 +} + +# Enable a PHP extension +# +# Arguments: +# $1: the name of the PHP extension to be enabled +# $2: base name (without path and extension) of additional php.ini configuration (optional) +# $3: additional php.ini configuration (optional) +enablePhpExtension() { + if test -n "${2:-}"; then + enablePhpExtension_iniFile="$PHP_INI_DIR/conf.d/$2.ini" + else + enablePhpExtension_iniFile="$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" + fi + enablePhpExtension_iniContent="$(buildPhpExtensionIniContent "$1" "${3:-}")" + case "${IPE_DONT_ENABLE:-}" in + 1 | y* | Y*) + enablePhpExtension_enableCommand="/usr/local/bin/docker-php-ext-enable-$1" + printf '%s' "$enablePhpExtension_iniContent" >"$enablePhpExtension_iniFile-disabled" + printf '\n' >>"$enablePhpExtension_iniFile-disabled" + cat <"$enablePhpExtension_enableCommand" +#!/bin/sh + +if test -f '$enablePhpExtension_iniFile-disabled'; then + echo 'Enabling extension $1' + mv '$enablePhpExtension_iniFile-disabled' '$enablePhpExtension_iniFile' +else + echo 'The extension $1 has already been enabled' +fi +EOT + chmod +x "$enablePhpExtension_enableCommand" + printf '## Extension %s not enabled.\nYou can enable it by running the following command:\n%s\n\n' "$1" "$(basename "$enablePhpExtension_enableCommand")" + ;; + *) + printf '%s' "$enablePhpExtension_iniContent" >"$enablePhpExtension_iniFile" + printf '\n' >>"$enablePhpExtension_iniFile" + ;; + esac +} + +# Mark the pre-installed APT/APK packages as used +# that way they won't be uninstalled by accident +markPreinstalledPackagesAsUsed() { + printf '### MARKING PRE-INSTALLED PACKAGES AS IN-USE ###\n' + case "$DISTRO" in + alpine) + printf '# Packages: %s\n' "$PACKAGES_PERSISTENT_PRE" + apk add $PACKAGES_PERSISTENT_PRE + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + ;; + esac +} + +# Install the required APT/APK packages +# +# Arguments: +# $@: the list of APT/APK packages to be installed +installRequiredPackages() { + printf '### INSTALLING REQUIRED PACKAGES ###\n' + printf '# Packages to be kept after installation: %s\n' "$PACKAGES_PERSISTENT_NEW" + printf '# Packages to be used only for installation: %s\n' "$PACKAGES_VOLATILE" + case "$DISTRO" in + alpine) + apk add $IPE_APK_FLAGS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + # https://gitlab.alpinelinux.org/alpine/aports/-/issues/12763#note_172090 + # https://github.com/mlocati/docker-php-extension-installer/issues/385 + # https://github.com/mlocati/docker-php-extension-installer/issues/537#issuecomment-1078748882 + for installRequiredPackages_item in wget; do + if test -n "$(expandInstalledSystemPackageName "$installRequiredPackages_item")"; then + apk add --upgrade "$installRequiredPackages_item" + fi + done + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + ;; + esac +} + +# Get the version of an installed APT/APK package +# +# Arguments: +# $1: the name of the installed package +# +# Output: +# The numeric part of the package version, with from 1 to 3 numbers +# +# Example: +# 1 +# 1.2 +# 1.2.3 +getInstalledPackageVersion() { + case "$DISTRO" in + alpine) + apk info "$1" | head -n1 | cut -c $((${#1} + 2))- | grep -o -E '^[0-9]+(\.[0-9]+){0,2}' + ;; + debian) + dpkg-query --showformat='${Version}' --show "$1" 2>/dev/null | grep -o -E '^[0-9]+(\.[0-9]+){0,2}' + ;; + esac +} + +# Compare two versions +# +# Arguments: +# $1: the first version +# $2: the second version +# +# Output +# -1 if $1 is less than $2 +# 0 if $1 is the same as $2 +# 1 if $1 is greater than $2 +compareVersions() { + compareVersions_v1="$1.0.0" + compareVersions_v2="$2.0.0" + compareVersions_vMin="$(printf '%s\n%s' "$compareVersions_v1" "$compareVersions_v2" | sort -t '.' -n -k1,1 -k2,2 -k3,3 | head -n 1)" + if test "$compareVersions_vMin" != "$compareVersions_v1"; then + echo '1' + elif test "$compareVersions_vMin" = "$compareVersions_v2"; then + echo '0' + else + echo '-1' + fi +} + +# Install Oracle Instant Client & SDK +# +# Set: +# ORACLE_INSTANTCLIENT_LIBPATH +installOracleInstantClient() { + case "${IPE_INSTANTCLIENT_BASIC:-}" in + 1 | y* | Y*) + installOracleInstantClient_handle=basic + ;; + *) + installOracleInstantClient_handle=basiclite + ;; + esac + case $PHP_BITS in + 32) + installOracleInstantClient_client=client + installOracleInstantClient_version='19.9' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-$installOracleInstantClient_handle-linux-$installOracleInstantClient_version.0.0.0dbru.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-sdk-linux-$installOracleInstantClient_version.0.0.0dbru.zip + ;; + *) + case $(uname -m) in + aarch64*) + installOracleInstantClient_client=client64 + installOracleInstantClient_version='19.10' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-$installOracleInstantClient_handle-linux.arm64-$installOracleInstantClient_version.0.0.0dbru.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-sdk-linux.arm64-$installOracleInstantClient_version.0.0.0dbru.zip + ;; + *) + installOracleInstantClient_client=client64 + installOracleInstantClient_version='21.1' + installOracleInstantClient_ic=https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-$installOracleInstantClient_handle-linux.x64-$installOracleInstantClient_version.0.0.0.zip + installOracleInstantClient_sdk=https://download.oracle.com/otn_software/linux/instantclient/211000/instantclient-sdk-linux.x64-$installOracleInstantClient_version.0.0.0.zip + ;; + esac + ;; + esac + ORACLE_INSTANTCLIENT_LIBPATH=/usr/lib/oracle/$installOracleInstantClient_version/$installOracleInstantClient_client/lib + if ! test -e "$ORACLE_INSTANTCLIENT_LIBPATH"; then + printf 'Downloading Oracle Instant Client v%s (%s)... ' "$installOracleInstantClient_version" "$installOracleInstantClient_handle" + installOracleInstantClient_src="$(getPackageSource $installOracleInstantClient_ic)" + mkdir -p "/usr/lib/oracle/$installOracleInstantClient_version/$installOracleInstantClient_client" + mv "$installOracleInstantClient_src" "$ORACLE_INSTANTCLIENT_LIBPATH" + echo 'done.' + fi + if ! test -e "$ORACLE_INSTANTCLIENT_LIBPATH/sdk"; then + printf 'Downloading Oracle Instant SDK v%s... ' "$installOracleInstantClient_version" + installOracleInstantClient_src="$(getPackageSource $installOracleInstantClient_sdk)" + ln -sf "$installOracleInstantClient_src/sdk" "$ORACLE_INSTANTCLIENT_LIBPATH/sdk" + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS '$ORACLE_INSTANTCLIENT_LIBPATH/sdk'" + echo 'done.' + fi + case "$DISTRO" in + alpine) + if ! test -e /usr/lib/libresolv.so.2 && test -e /lib/libc.so.6; then + ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 + fi + installOracleInstantClient_ldconf=/etc/ld-musl-${TARGET_TRIPLET%-alpine-linux-musl}.path + if test -e "$installOracleInstantClient_ldconf"; then + if ! cat "$installOracleInstantClient_ldconf" | grep -q "$ORACLE_INSTANTCLIENT_LIBPATH"; then + cat "$ORACLE_INSTANTCLIENT_LIBPATH" | awk -v suffix=":$ORACLE_INSTANTCLIENT_LIBPATH" '{print NR==1 ? $0suffix : $0}' >"$ORACLE_INSTANTCLIENT_LIBPATH" + fi + else + case $PHP_BITS in + 32) + echo "/lib:/usr/local/lib:/usr/lib:$ORACLE_INSTANTCLIENT_LIBPATH" >"$installOracleInstantClient_ldconf" + ;; + *) + echo "/lib64:/lib:/usr/local/lib:/usr/lib:$ORACLE_INSTANTCLIENT_LIBPATH" >"$installOracleInstantClient_ldconf" + ;; + esac + fi + ;; + debian) + if ! test -e /etc/ld.so.conf.d/oracle-instantclient.conf; then + echo "$ORACLE_INSTANTCLIENT_LIBPATH" >/etc/ld.so.conf.d/oracle-instantclient.conf + ldconfig + fi + ;; + esac +} + +# Check if the Microsoft SQL Server ODBC Driver is installed +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +isMicrosoftSqlServerODBCInstalled() { + test -d /opt/microsoft/msodbcsql*/ +} + +# Install the Microsoft SQL Server ODBC Driver +installMicrosoftSqlServerODBC() { + printf 'Installing the Microsoft SQL Server ODBC Driver\n' + case "$DISTRO" in + alpine) + # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#alpine17 + rm -rf /tmp/src/msodbcsql.apk + if test $PHP_MAJMIN_VERSION -le 703; then + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.9.1.1-1_amd64.apk + else + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/msodbcsql18_18.0.1.1-1_amd64.apk + fi + printf '\n' | apk add --allow-untrusted /tmp/src/msodbcsql.apk + rm -rf /tmp/src/msodbcsql.apk + ;; + debian) + # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#debian17 + printf -- '- installing the Microsoft APT key\n' + if test $DISTRO_VERSION_NUMBER -ge 11; then + # apt-key is deprecated + curl -sSLf -o /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc + else + curl -sSLf https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + fi + if ! test -f /etc/apt/sources.list.d/mssql-release.list; then + printf -- '- adding the Microsoft APT source list\n' + curl -sSLf https://packages.microsoft.com/config/debian/$DISTRO_VERSION_NUMBER/prod.list >/etc/apt/sources.list.d/mssql-release.list + invokeAptGetUpdate + fi + printf -- '- installing the APT package\n' + if test $PHP_MAJMIN_VERSION -le 703; then + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + elif test $DISTRO_VERSION_NUMBER -ge 9 && $DISTRO_VERSION_NUMBER -le 11; then + # On Debian 9 and 11 we have both msodbcsql17 and msodbcsql18: let's install just one + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + else + DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + fi + ;; + esac +} + +# Check if libaom is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibaomInstalled() { + if ! test -f /usr/local/lib/libaom.so && ! test -f /usr/lib/libaom.so; then + return 1 + fi + if ! test -f /usr/local/include/aom/aom_codec.h && ! test -f /usr/include/aom/aom_codec.h; then + return 1 + fi + return 0 +} + +# Install libaom +installLibaom() { + printf 'Installing libaom\n' + installLibaom_dir="$(getPackageSource https://aomedia.googlesource.com/aom/+archive/v3.3.0.tar.gz)" + mkdir -- "$installLibaom_dir/my.build" + cd -- "$installLibaom_dir/my.build" + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 -DCMAKE_INSTALL_LIBDIR:PATH=lib .. + ninja -j $(getProcessorCount) install + cd - >/dev/null + ldconfig || true +} + +# Check if libdav1d is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibdav1dInstalled() { + if ! test -f /usr/local/lib/libdav1d.so && ! test -f /usr/lib/libdav1d.so && ! test -f /usr/lib/x86_64*/libdav1d.so; then + return 1 + fi + if ! test -f /usr/local/include/dav1d/dav1d.h && ! test -f /usr/include/dav1d/dav1d.h; then + return 1 + fi + return 0 +} + +# Install libdav1d +installLibdav1d() { + printf 'Installing libdav1d\n' + installLibdav1d_dir="$(getPackageSource https://code.videolan.org/videolan/dav1d/-/archive/0.9.2/dav1d-0.9.2.tar.gz)" + mkdir -- "$installLibdav1d_dir/build" + cd -- "$installLibdav1d_dir/build" + meson --buildtype release -Dprefix=/usr .. + ninja -j $(getProcessorCount) install + cd - >/dev/null + if test -f /usr/lib/$TARGET_TRIPLET/libdav1d.so && ! test -f /usr/lib/libdav1d.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libdav1d.so /usr/lib/ + fi + ldconfig || true +} + +# Check if libyuv is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibyuvInstalled() { + if ! test -f /usr/local/lib/libyuv.so && ! test -f /usr/lib/libyuv.so && ! test -f /usr/lib/x86_64*/libyuv.so; then + return 1 + fi + if ! test -f /usr/local/include/libyuv.h && ! test -f /usr/include/libyuv.h; then + return 1 + fi + return 0 +} + +# Install libyuv +installLibyuv() { + printf 'Installing libyuv\n' + installLibyuv_dir="$(getPackageSource https://chromium.googlesource.com/libyuv/libyuv/+archive/25d0a5110be796eef47004412baf43333d9ecf26.tar.gz)" + mkdir -- "$installLibyuv_dir/build" + cd -- "$installLibyuv_dir/build" + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -B. .. + make -j$(getProcessorCount) install + cd - >/dev/null +} + +# Check if libavif is installed +# +# Return: +# 0 (true) +# 1 (false) +isLibavifInstalled() { + if ! test -f /usr/local/lib/libavif.so && ! test -f /usr/lib/libavif.so && ! test -f /usr/lib/x86_64*/libavif.so; then + return 1 + fi + if ! test -f /usr/local/include/avif/avif.h && ! test -f /usr/include/avif/avif.h; then + return 1 + fi + return 0 +} + +# Install libavif +installLibavif() { + printf 'Installing libavif\n' + installLibavif_dir="$(getPackageSource https://codeload.github.com/AOMediaCodec/libavif/tar.gz/refs/tags/v0.9.3)" + mkdir -- "$installLibavif_dir/build" + cd -- "$installLibavif_dir/build" + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DAVIF_CODEC_AOM=ON -DCMAKE_INSTALL_LIBDIR:PATH=lib + make -j$(getProcessorCount) install + cd - >/dev/null +} + +# Install Composer +installComposer() { + installComposer_version="$(getWantedPHPModuleVersion @composer)" + installComposer_version="${installComposer_version#^}" + if test -z "$installComposer_version"; then + installComposer_fullname=composer + installComposer_flags='' + else + installComposer_fullname="$(printf 'composer v%s' "$installComposer_version")" + if printf '%s' "$installComposer_version" | grep -Eq '^[0-9]+$'; then + installComposer_flags="--$installComposer_version" + else + installComposer_flags="--version=$installComposer_version" + fi + fi + printf '### INSTALLING %s ###\n' "$installComposer_fullname" + actuallyInstallComposer /usr/local/bin composer "$installComposer_flags" +} + +# Actually install composer +# +# Arguments: +# $1: the directory where composer should be installed (required) +# $2: the composer filename (optional, default: composer) +# $3. additional flags for the composer installed (optional) +actuallyInstallComposer() { + actuallyInstallComposer_installer="$(mktemp -p /tmp/src)" + curl -sSLf -o "$actuallyInstallComposer_installer" https://getcomposer.org/installer + actuallyInstallComposer_expectedSignature="$(curl -sSLf https://composer.github.io/installer.sig)" + actuallyInstallComposer_actualSignature="$(php -n -r "echo hash_file('sha384', '$actuallyInstallComposer_installer');")" + if test "$actuallyInstallComposer_expectedSignature" != "$actuallyInstallComposer_actualSignature"; then + printf 'Verification of composer installer failed!\nExpected signature: %s\nActual signature: %s\n' "$actuallyInstallComposer_expectedSignature" "$actuallyInstallComposer_actualSignature" >&2 + exit 1 + fi + actuallyInstallComposer_flags="--install-dir=$1" + if test -n "${2:-}"; then + actuallyInstallComposer_flags="$actuallyInstallComposer_flags --filename=$2" + else + actuallyInstallComposer_flags="$actuallyInstallComposer_flags --filename=composer" + fi + if test -n "${3:-}"; then + actuallyInstallComposer_flags="$actuallyInstallComposer_flags $3" + fi + php "$actuallyInstallComposer_installer" $actuallyInstallComposer_flags + rm -- "$actuallyInstallComposer_installer" +} + +# Install ionCube Loader +installIonCubeLoader() { + # See https://www.ioncube.com/loaders.php + case $PHP_BITS in + 32) + case $(uname -m) in + aarch* | arm*) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.tar.gz" + ;; + *) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" + ;; + esac + ;; + *) + case $(uname -m) in + aarch64 | arm64 | armv8) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_aarch64.tar.gz" + ;; + *) + installIonCubeLoader_url="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" + ;; + esac + ;; + esac + printf 'Downloading ionCube Loader... ' + installIonCubeLoader_dir="$(getPackageSource $installIonCubeLoader_url)" + echo 'done.' + installIonCubeLoader_so=$(php -r "printf('ioncube_loader_lin_%s.%s%s.so', PHP_MAJOR_VERSION, PHP_MINOR_VERSION, ZEND_THREAD_SAFE ? '_ts' : '');") + cp "$installIonCubeLoader_dir/$installIonCubeLoader_so" "$(getPHPExtensionsDir)/ioncube_loader.so" +} + +# Install SourceGuardian Loader +installSourceGuardian() { + # See https://www.sourceguardian.com/loaders.html + case $PHP_BITS in + 32) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-i386.tar.gz + ;; + *) + case $(uname -m) in + aarch64 | arm64 | armv8) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz + ;; + *) + installSourceGuardian_url=https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz + ;; + esac + ;; + esac + printf 'Downloading SourceGuardian... ' + installSourceGuardian_dir="$(getPackageSource $installSourceGuardian_url)" + printf 'done (version: %s)\n' "$(cat "$installSourceGuardian_dir/version")" + for installSourceGuardian_phpv in $PHP_MAJDOTMINDOTPAT_VERSION $PHP_MAJDOTMIN_VERSION; do + installSourceGuardian_file="$installSourceGuardian_dir/ixed.$PHP_MAJDOTMIN_VERSION" + if test $PHP_THREADSAFE -eq 1; then + installSourceGuardian_file="${installSourceGuardian_file}ts" + fi + installSourceGuardian_file="${installSourceGuardian_file}.lin" + if test -f "$installSourceGuardian_file"; then + mv "$installSourceGuardian_file" "$(getPHPExtensionsDir)/sourceguardian.so" + return + fi + done + printf 'Unable to find a SourceGuardian compatible with PHP %s or PHP %s.\nAvailable SourceGuardian versions:\n' "$PHP_MAJDOTMINDOTPAT_VERSION" "$PHP_MAJDOTMIN_VERSION" >&2 + ls -1 "$installSourceGuardian_dir" | grep -E '^ixed\..*\.lin$' | sed -E 's/^[^0-9]+([0-9]+(\.[0-9]+)*).*$/\1/' | sort | uniq >&2 + exit 1 +} + +# Install a bundled PHP module given its handle +# +# Arguments: +# $1: the handle of the PHP module +# +# Set: +# UNNEEDED_PACKAGE_LINKS +# +# Output: +# Nothing +installBundledModule() { + printf '### INSTALLING BUNDLED MODULE %s ###\n' "$1" + if test -n "$(getWantedPHPModuleVersion "$1")"; then + printf '### WARNING the module "%s" is bundled with PHP, you can NOT specify a version for it\n' "$1" >&2 + fi + if test -n "$(getModuleSourceCodePath "$1")"; then + printf '### WARNING the module "%s" is bundled with PHP, you can NOT specify a source code path for it\n' "$1" >&2 + fi + case "$1" in + dba) + if test -e /usr/lib/$TARGET_TRIPLET/libdb-5.3.so && ! test -e /usr/lib/libdb-5.3.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libdb-5.3.so /usr/lib/ + fi + if test $PHP_MAJMIN_VERSION -le 505; then + docker-php-source extract + patch /usr/src/php/ext/dba/config.m4 </dev/null + fi + ;; + gd) + if test $PHP_MAJMIN_VERSION -le 506; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-vpx-dir + elif test $PHP_MAJMIN_VERSION -le 701; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-webp-dir + elif test $PHP_MAJMIN_VERSION -le 703; then + docker-php-ext-configure gd --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir --with-webp-dir + elif test $PHP_MAJMIN_VERSION -le 800; then + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype + else + installBundledModule_tmp=0 + case "$DISTRO" in + alpine) + if test $DISTRO_MAJMIN_VERSION -ge 315; then + installBundledModule_tmp=1 + fi + ;; + esac + if test $installBundledModule_tmp -eq 0; then + case "${IPE_GD_WITHOUTAVIF:-}" in + 1 | y* | Y*) ;; + *) + if ! isLibaomInstalled; then + installLibaom + fi + if ! isLibdav1dInstalled; then + installLibdav1d + fi + if ! isLibyuvInstalled; then + installLibyuv + fi + if ! isLibavifInstalled; then + installLibavif + fi + ;; + esac + if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then + installBundledModule_tmp=1 + fi + fi + if test $installBundledModule_tmp -eq 1; then + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif + else + docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype + fi + fi + ;; + gmp) + if test $PHP_MAJMIN_VERSION -le 506; then + if ! test -f /usr/include/gmp.h; then + ln -s /usr/include/$TARGET_TRIPLET/gmp.h /usr/include/gmp.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/gmp.h" + fi + fi + ;; + imap) + case "$DISTRO_VERSION" in + debian@9) + installBundledModule_tmp="$(pwd)" + cd /tmp + apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* + rm libc-client2007e-dev* + cd "$installBundledModule_tmp" + ;; + esac + PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl + ;; + interbase | pdo_firebird) + case "$DISTRO" in + alpine) + if ! test -d /tmp/src/firebird; then + mv "$(getPackageSource https://github.com/FirebirdSQL/firebird/releases/download/R2_5_9/Firebird-2.5.9.27139-0.tar.bz2)" /tmp/src/firebird + cd /tmp/src/firebird + # Patch rwlock.h (this has been fixed in later release of firebird 3.x) + sed -i '194s/.*/#if 0/' src/common/classes/rwlock.h + ./configure --with-system-icu + # -j option can't be used: make targets must be compiled sequentially + make -s btyacc_binary gpre_boot libfbstatic libfbclient + cp gen/firebird/lib/libfbclient.so /usr/lib/ + ln -s /usr/lib/libfbclient.so /usr/lib/libfbclient.so.2 + cd - >/dev/null + fi + CFLAGS='-I/tmp/src/firebird/src/jrd -I/tmp/src/firebird/src/include -I/tmp/src/firebird/src/include/gen' docker-php-ext-configure $1 + ;; + esac + ;; + ldap) + case "$DISTRO" in + debian) + docker-php-ext-configure ldap --with-libdir=lib/$TARGET_TRIPLET + ;; + esac + ;; + mssql | pdo_dblib) + if ! test -f /usr/lib/libsybdb.so; then + ln -s /usr/lib/$TARGET_TRIPLET/libsybdb.so /usr/lib/libsybdb.so + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/lib/libsybdb.so" + fi + ;; + odbc) + docker-php-source extract + cd /usr/src/php/ext/odbc + phpize + sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure + ./configure --with-unixODBC=shared,/usr + cd - >/dev/null + ;; + oci8 | pdo_oci) + installOracleInstantClient + if test "$1" = oci8; then + docker-php-ext-configure "$1" "--with-oci8=instantclient,$ORACLE_INSTANTCLIENT_LIBPATH" + elif test "$1" = pdo_oci; then + docker-php-ext-configure "$1" "--with-pdo-oci=instantclient,$ORACLE_INSTANTCLIENT_LIBPATH" + fi + ;; + pdo_odbc) + docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr + ;; + snmp) + case "$DISTRO" in + alpine) + mkdir -p -m 0755 /var/lib/net-snmp/mib_indexes + ;; + esac + ;; + sockets) + case "$PHP_MAJDOTMINDOTPAT_VERSION" in + 8.0.15 | 8.1.2) + sed -i '70 i #ifndef _GNU_SOURCE' /usr/src/php/ext/sockets/config.m4 + sed -i '71 i #define _GNU_SOURCE' /usr/src/php/ext/sockets/config.m4 + sed -i '72 i #endif' /usr/src/php/ext/sockets/config.m4 + ;; + esac + ;; + sybase_ct) + docker-php-ext-configure sybase_ct --with-sybase-ct=/usr + ;; + tidy) + case "$DISTRO" in + alpine) + if ! test -f /usr/include/buffio.h; then + ln -s /usr/include/tidybuffio.h /usr/include/buffio.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/buffio.h" + fi + ;; + esac + ;; + zip) + if test $PHP_MAJMIN_VERSION -le 505; then + docker-php-ext-configure zip + elif test $PHP_MAJMIN_VERSION -le 703; then + docker-php-ext-configure zip --with-libzip + else + docker-php-ext-configure zip --with-zip + fi + ;; + esac + installBundledModule_errBefore="$(php -r 'return;' 2>&1 || true)" + docker-php-ext-install -j$(getProcessorCount) "$1" + case "$1" in + imap) + case "$DISTRO_VERSION" in + debian@9) + dpkg -r libc-client2007e-dev + ;; + esac + ;; + esac + php -r 'return;' >/dev/null 2>/dev/null || true + installBundledModule_errAfter="$(php -r 'return;' 2>&1 || true)" + if test "$installBundledModule_errAfter" != "$installBundledModule_errBefore"; then + printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_errAfter" >&2 + rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true + return 1 + fi +} + +# Fetch a tar.gz file, extract it and returns the path of the extracted folder. +# +# Arguments: +# $1: the URL of the file to be downloaded +# +# Output: +# The path of the extracted directory +getPackageSource() { + mkdir -p /tmp/src + getPackageSource_tempFile=$(mktemp -p /tmp/src) + curl -sSLf -o "$getPackageSource_tempFile" "$1" + getPackageSource_tempDir=$(mktemp -p /tmp/src -d) + cd "$getPackageSource_tempDir" + tar -xzf "$getPackageSource_tempFile" 2>/dev/null || tar -xf "$getPackageSource_tempFile" 2>/dev/null || ( + if command -v bsdtar >/dev/null; then + bsdtar -xf "$getPackageSource_tempFile" + else + unzip -q "$getPackageSource_tempFile" + fi + ) + cd - >/dev/null + unlink "$getPackageSource_tempFile" + getPackageSource_outDir='' + for getPackageSource_i in $(ls "$getPackageSource_tempDir"); do + if test -n "$getPackageSource_outDir" || test -f "$getPackageSource_tempDir/$getPackageSource_i"; then + getPackageSource_outDir='' + break + fi + getPackageSource_outDir="$getPackageSource_tempDir/$getPackageSource_i" + done + if test -n "$getPackageSource_outDir"; then + printf '%s' "$getPackageSource_outDir" + else + printf '%s' "$getPackageSource_tempDir" + fi +} + +# Install a PECL/remote PHP module given its handle +# +# Arguments: +# $1: the handle of the PHP module +installRemoteModule() { + installRemoteModule_module="$1" + printf '### INSTALLING REMOTE MODULE %s ###\n' "$installRemoteModule_module" + installRemoteModule_version="$(resolveWantedPHPModuleVersion "$installRemoteModule_module")" + installRemoteModule_path="$(getModuleSourceCodePath "$installRemoteModule_module")" + rm -rf "$CONFIGURE_FILE" + installRemoteModule_manuallyInstalled=0 + installRemoteModule_cppflags='' + installRemoteModule_ini_basename='' + installRemoteModule_ini_extra='' + case "$installRemoteModule_module" in + amqp) + if test -z "$installRemoteModule_version"; then + if test "$DISTRO_VERSION" = debian@8; then + # in Debian Jessie we have librabbitmq version 0.5.2 + installRemoteModule_version=1.9.3 + elif test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version=1.9.4 + fi + fi + ;; + apcu) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=4.0.11 + fi + fi + ;; + apcu_bc) + # apcu_bc must be loaded after apcu + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + ast) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.0.16 + fi + fi + ;; + blackfire) + case $(uname -m) in + i386 | i686 | x86) + installRemoteModule_tmp1=i386 + ;; + aarch64 | arm64 | armv8) + installRemoteModule_tmp1=arm64 + ;; + *) + installRemoteModule_tmp1=amd64 + ;; + esac + case $DISTRO in + alpine) + installRemoteModule_distro=alpine + ;; + *) + installRemoteModule_distro=linux + ;; + esac + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" + cd "$installRemoteModule_tmp" + curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz + mv blackfire-*.so $(getPHPExtensionsDir)/blackfire.so + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + installRemoteModule_ini_extra="$(printf '%sblackfire.agent_socket=tcp://blackfire:8307\n' "$installRemoteModule_ini_extra")" + ;; + cassandra) + installRemoteModule_src="$(getPackageSource https://github.com/nano-interactive/ext-cassandra/tarball/1cf12c5ce49ed43a2c449bee4b7b23ce02a37bf0)" + cd "$installRemoteModule_src/ext" + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + ;; + cmark) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.1.0 + fi + fi + if ! test -e /usr/local/lib/libcmark.so && ! test -e /usr/local/lib64/libcmark.so && ! test -e /usr/lib/libcmark.so && ! test -e /usr/lib64/libcmark.so && ! test -e /lib/libcmark.so; then + if test $(compareVersions "$(cmake --version | head -n1 | sed -E 's/^.* //')" '3.7') -lt 0; then + installRemoteModule_tmp=0.29.0 + else + installRemoteModule_tmp=0.30.3 + fi + cd "$(getPackageSource https://github.com/commonmark/cmark/archive/$installRemoteModule_tmp.tar.gz)" + make -s -j$(getProcessorCount) cmake_build + make -s -j$(getProcessorCount) install + cd - >/dev/null + case "$DISTRO" in + alpine) + if test -e /usr/local/lib64/libcmark.so.$installRemoteModule_tmp && ! test -e /usr/local/lib/libcmark.so.$installRemoteModule_tmp; then + ln -s /usr/local/lib64/libcmark.so.$installRemoteModule_tmp /usr/local/lib/ + fi + ;; + *) + ldconfig || true + ;; + esac + fi + ;; + csv) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=0.3.1 + fi + fi + ;; + ddtrace) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=0.75.0 + fi + fi + ;; + decimal) + case "$DISTRO" in + alpine) + if ! test -f /usr/local/lib/libmpdec.so; then + installRemoteModule_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure --disable-cxx + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + ;; + esac + ;; + ds) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=1.3.0 + fi + fi + ;; + event) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.4.0) -ge 0; then + # Enable internal debugging in Event + addConfigureOption enable-event-debug no + # Enable sockets support in Event + if php --ri sockets >/dev/null 2>/dev/null; then + addConfigureOption enable-event-sockets yes + else + addConfigureOption enable-event-sockets no + fi + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in Event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # PHP Namespace for all Event classes + if test -n "${IPE_EVENT_NAMESPACE:-}"; then + addConfigureOption with-event-ns "$IPE_EVENT_NAMESPACE" + else + addConfigureOption with-event-ns no + fi + # openssl installation prefix + addConfigureOption with-openssl-dir yes + elif test $(compareVersions "$installRemoteModule_version" 1.7.6) -ge 0; then + # Enable internal debugging in Event + addConfigureOption enable-event-debug no + # Enable sockets support in Event + if php --ri sockets >/dev/null 2>/dev/null; then + addConfigureOption enable-event-sockets yes + else + addConfigureOption enable-event-sockets no + fi + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in Event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # openssl installation prefix + addConfigureOption with-openssl-dir no + elif test $(compareVersions "$installRemoteModule_version" 1.3.0) -ge 0; then + # Enable internal debugging in event + addConfigureOption enable-event-debug no + # libevent installation prefix + addConfigureOption with-event-libevent-dir /usr + # Include libevent's pthreads library and enable thread safety support in event + addConfigureOption with-event-pthreads yes + # Include libevent protocol-specific functionality support including HTTP, DNS, and RPC + addConfigureOption with-event-extra yes + # Include libevent OpenSSL support + addConfigureOption with-event-openssl yes + # openssl installation prefix + addConfigureOption with-openssl-dir no + fi + # event must be loaded after sockets + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + excimer) + if test -z "$installRemoteModule_version"; then + if test "$DISTRO" = alpine && test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=1.0.4 + fi + fi + ;; + gearman) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.2 + fi + fi + case "$DISTRO" in + alpine) + if ! test -e /usr/local/include/libgearman/gearman.h || ! test -e /usr/local/lib/libgearman.so; then + installRemoteModule_src="$(getPackageSource https://github.com/gearman/gearmand/releases/download/1.1.20/gearmand-1.1.20.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure + make -j$(getProcessorCount) install-binPROGRAMS + make -j$(getProcessorCount) install-nobase_includeHEADERS + cd - >/dev/null + fi + ;; + esac + ;; + geoip) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + geos) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=71b5f9001512e16d3cf4657b517e8a051d6ef36f + fi + installRemoteModule_src="$(getPackageSource https://git.osgeo.org/gitea/geos/php-geos/archive/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + ./autogen.sh + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + geospatial) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.2.1 + else + installRemoteModule_version=beta + fi + fi + ;; + gmagick) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.7RC3 + else + installRemoteModule_version=beta + fi + fi + ;; + grpc) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.33.1 + fi + fi + if test -z "$installRemoteModule_version" || test "$installRemoteModule_version" = 1.35.0; then + case "$DISTRO_VERSION" in + alpine@3.13) + installRemoteModule_cppflags='-Wno-maybe-uninitialized' + ;; + esac + fi + if test -z "$installRemoteModule_version"; then + case "$DISTRO_VERSION" in + debian@8) + installRemoteModule_version=1.46.3 + ;; + esac + fi + ;; + http) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.6.0 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=3.2.4 + fi + fi + if test $PHP_MAJMIN_VERSION -ge 700; then + if ! test -e /usr/local/lib/libidnkit.so; then + installRemoteModule_src="$(getPackageSource https://jprs.co.jp/idn/idnkit-2.3.tar.bz2)" + cd -- "$installRemoteModule_src" + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + fi + fi + # http must be loaded after raphf and propro + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + igbinary) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.8 + fi + fi + ;; + inotify) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.1.6 + fi + fi + ;; + ion) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=alpha + fi + if ! test -f /usr/local/lib/libionc.so || ! test -f /usr/local/include/ionc/ion.h; then + echo 'Installing ion-c... ' + installRemoteModule_src="$(mktemp -p /tmp/src -d)" + git clone -q -c advice.detachedHead=false --depth 1 --branch v1.1.1 https://github.com/amzn/ion-c.git "$installRemoteModule_src/ion" + ( + cd "$installRemoteModule_src/ion" + git submodule init -q + git submodule update -q + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=Release .. -Wno-dev + make clean + make -j$(getProcessorCount) install + ) + rm -rf "$installRemoteModule_src" + fi + addConfigureOption with-ion "shared,/usr/local" + ;; + ioncube_loader) + installIonCubeLoader + installRemoteModule_manuallyInstalled=1 + ;; + jsmin) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=2.0.1 + fi + fi + ;; + luasandbox) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 702; then + installRemoteModule_version=3.0.3 + fi + fi + ;; + lz4) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.4.3 + fi + installRemoteModule_src="$(getPackageSource https://github.com/kjdev/php-ext-lz4/archive/refs/tags/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + phpize + ./configure --with-lz4-includedir=/usr + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + lzf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 702; then + installRemoteModule_version=1.6.8 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Sacrifice speed in favour of compression ratio? + case "${IPE_LZF_BETTERCOMPRESSION:-}" in + 1 | y* | Y*) + addConfigureOption 'enable-lzf-better-compression' 'yes' + ;; + *) + addConfigureOption 'enable-lzf-better-compression' 'no' + ;; + esac + fi + ;; + mailparse) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.1.6 + elif test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=3.1.3 + fi + fi + ;; + memcache) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.2.7 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=4.0.5.2 + fi + fi + ;; + memcached) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.2.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + # Set the path to libmemcached install prefix + addConfigureOption 'with-libmemcached-dir' 'no' + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '3.0.0') -ge 0; then + # Set the path to ZLIB install prefix + addConfigureOption 'with-zlib-dir' 'no' + # Use system FastLZ library + addConfigureOption 'with-system-fastlz' 'no' + # Enable memcached igbinary serializer support + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption 'enable-memcached-igbinary' 'yes' + else + addConfigureOption 'enable-memcached-igbinary' 'no' + fi + # Enable memcached msgpack serializer support + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption 'enable-memcached-msgpack' 'yes' + else + addConfigureOption 'enable-memcached-msgpack' 'no' + fi + # Enable memcached json serializer support + addConfigureOption 'enable-memcached-json' 'yes' + # Enable memcached protocol support + addConfigureOption 'enable-memcached-protocol' 'no' # https://github.com/php-memcached-dev/php-memcached/issues/418#issuecomment-449587972 + # Enable memcached sasl support + addConfigureOption 'enable-memcached-sasl' 'yes' + # Enable memcached session handler support + addConfigureOption 'enable-memcached-session' 'yes' + fi + # memcached must be loaded after msgpack + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + ;; + memprof) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.0 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.1.0 + fi + fi + ;; + mongo) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '1.5.0') -ge 0; then + # Build with Cyrus SASL (MongoDB Enterprise Authentication) support? + addConfigureOption '-with-mongo-sasl' 'yes' + fi + ;; + mongodb) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version=1.5.5 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.7.5 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=1.9.2 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.11.1 + fi + fi + ;; + mosquitto) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + msgpack) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.5.7 + fi + fi + ;; + oauth) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.2.3 + fi + fi + ;; + opencensus) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=alpha + fi + ;; + openswoole) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 704; then + installRemoteModule_version=4.10.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if php --ri sockets >/dev/null 2>/dev/null; then + installRemoteModule_sockets=yes + installRemoteModule_ini_basename="xx-php-ext-$installRemoteModule_module" + else + installRemoteModule_sockets=no + fi + installRemoteModule_openssl=yes + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '22.8.0') -ge 0; then + #enable hook curl support? + addConfigureOption enable-hook-curl yes + # enable postgres support? + addConfigureOption with-postgres yes + else + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '4.8.0') -ge 0; then + # enable postgres support? + addConfigureOption with-postgres yes + fi + fi + ;; + parallel) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=0.8.3 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=1.1.4 + fi + fi + ;; + parle) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + pcov) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=0.9.0 + fi + fi + ;; + php_trie) + if ! test -f /usr/local/include/hat-trie/include/tsl/htrie_map.h; then + installRemoteModule_src="$(getPackageSource https://codeload.github.com/Tessil/hat-trie/tar.gz/v0.6.0)" + mkdir -p /usr/local/include/hat-trie + mv "$installRemoteModule_src/include" /usr/local/include/hat-trie + fi + ;; + propro) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.2 + fi + fi + ;; + protobuf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=3.12.4 + else + # see https://github.com/protocolbuffers/protobuf/issues/10619 + installRemoteModule_version=3.21.6 + fi + fi + ;; + pthreads) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.10 + fi + fi + ;; + raphf) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.2 + fi + fi + ;; + rdkafka) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version"; then + installRemoteModule_version1='' + if test $PHP_MAJMIN_VERSION -le 505; then + installRemoteModule_version1=3.0.5 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version1=4.1.2 + fi + installRemoteModule_version2='' + case "$DISTRO" in + alpine) + installRemoteModule_tmp='librdkafka' + ;; + debian) + installRemoteModule_tmp='librdkafka*' + ;; + *) + installRemoteModule_tmp='' + ;; + esac + if test -n "$installRemoteModule_tmp"; then + installRemoteModule_tmp="$(getInstalledPackageVersion "$installRemoteModule_tmp")" + if test -n "$installRemoteModule_tmp" && test $(compareVersions "$installRemoteModule_tmp" '0.11.0') -lt 0; then + installRemoteModule_version2=3.1.3 + fi + fi + if test -z "$installRemoteModule_version1" || test -z "$installRemoteModule_version2"; then + installRemoteModule_version="$installRemoteModule_version1$installRemoteModule_version2" + elif test $(compareVersions "$installRemoteModule_version1" "$installRemoteModule_version2") -le 0; then + installRemoteModule_version="$installRemoteModule_version1" + else + installRemoteModule_version="$installRemoteModule_version2" + fi + fi + ;; + redis) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=4.3.0 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + # Enable igbinary serializer support? + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption 'enable-redis-igbinary' 'yes' + else + addConfigureOption 'enable-redis-igbinary' 'no' + fi + # Enable lzf compression support? + addConfigureOption 'enable-redis-lzf' 'yes' + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" '5.0.0') -ge 0; then + if ! test -e /usr/include/zstd.h || ! test -e /usr/lib/libzstd.so -o -e "/usr/lib/$TARGET_TRIPLET/libzstd.so"; then + installRemoteModule_zstdVersion=1.4.4 + installRemoteModule_zstdVersionMajor=$(echo $installRemoteModule_zstdVersion | cut -d. -f1) + rm -rf /tmp/src/zstd + mv "$(getPackageSource https://github.com/facebook/zstd/releases/download/v$installRemoteModule_zstdVersion/zstd-$installRemoteModule_zstdVersion.tar.gz)" /tmp/src/zstd + cd /tmp/src/zstd + make V=0 -j$(getProcessorCount) lib + cp -f lib/libzstd.so "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" + ln -sf "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersionMajor" + ln -sf "/usr/lib/$TARGET_TRIPLET/libzstd.so.$installRemoteModule_zstdVersion" "/usr/lib/$TARGET_TRIPLET/libzstd.so" + ln -sf /tmp/src/zstd/lib/zstd.h /usr/include/zstd.h + UNNEEDED_PACKAGE_LINKS="$UNNEEDED_PACKAGE_LINKS /usr/include/zstd.h" + cd - >/dev/null + fi + # Enable zstd compression support? + addConfigureOption 'enable-redis-zstd' 'yes' + fi + ;; + relay) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version="$(curl -sSLf https://builds.r2.relay.so/meta/latest)" + installRemoteModule_version="${installRemoteModule_version#v}" + fi + case $(uname -m) in + aarch64 | arm64 | armv8) + installRemoteModule_hardware=aarch64 + ;; + *) + installRemoteModule_hardware=x86-64 + ;; + esac + printf 'Downloading relay v%s (%s)... ' "$installRemoteModule_version" "$installRemoteModule_hardware" + installRemoteModule_url="https://builds.r2.relay.so/v${installRemoteModule_version}/relay-v${installRemoteModule_version}-php${PHP_MAJDOTMIN_VERSION}-${DISTRO}-${installRemoteModule_hardware}.tar.gz" + installRemoteModule_src="$(getPackageSource $installRemoteModule_url)" + echo 'done.' + cp -- "$installRemoteModule_src/relay-pkg.so" "$PHP_EXTDIR/relay.so" + sed -i "s/00000000-0000-0000-0000-000000000000/$(cat /proc/sys/kernel/random/uuid)/" "$PHP_EXTDIR/relay.so" + installRemoteModule_ini_extra="$(grep -vE '^[ \t]*extension[ \t]*=' $installRemoteModule_src/relay.ini)" + installRemoteModule_manuallyInstalled=1 + ;; + snappy) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.2.1 + fi + installRemoteModule_src="$(getPackageSource https://github.com/kjdev/php-ext-snappy/archive/refs/tags/$installRemoteModule_version.tar.gz)" + cd "$installRemoteModule_src" + phpize + ./configure --with-snappy-includedir=/usr + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + snuffleupagus) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=0.8.2 + fi + installRemoteModule_src="$(getPackageSource https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v$installRemoteModule_version)" + cd "$installRemoteModule_src/src" + phpize + ./configure --enable-snuffleupagus + make -j$(getProcessorCount) install + cd - >/dev/null + cp -a "$installRemoteModule_src/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules" + if test $(compareVersions "$installRemoteModule_version" 0.8.0) -ge 0; then + printf '\n# Disable "PHP version is not officially maintained anymore" message\nsp.global.show_old_php_warning.disable();\n' >>"$PHP_INI_DIR/conf.d/snuffleupagus.rules" + fi + else + if test -f "$installRemoteModule_path/config/default.rules"; then + cp -a "$installRemoteModule_path/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules" + fi + fi + installRemoteModule_ini_extra="$(printf '%ssp.configuration_file=%s\n' "$installRemoteModule_ini_extra" "$PHP_INI_DIR/conf.d/snuffleupagus.rules")" + installRemoteModule_manuallyInstalled=1 + ;; + sodium | libsodium) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -lt 700; then + installRemoteModule_version=1.0.7 + fi + fi + ;; + solr) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.4.0 + fi + fi + ;; + sourceguardian) + installSourceGuardian + installRemoteModule_manuallyInstalled=1 + ;; + spx) + if test -z "$installRemoteModule_path"; then + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=v0.4.13 + fi + if test "${installRemoteModule_version%.*}" = "$installRemoteModule_version"; then + installRemoteModule_displayVersion="$installRemoteModule_version" + else + installRemoteModule_displayVersion="git--master-$installRemoteModule_version" + fi + installRemoteModule_src="$(getPackageSource https://codeload.github.com/NoiseByNorthwest/php-spx/tar.gz/$installRemoteModule_version)" + cd -- "$installRemoteModule_src" + phpize + ./configure + make -j$(getProcessorCount) install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + sqlsrv | pdo_sqlsrv) + isMicrosoftSqlServerODBCInstalled || installMicrosoftSqlServerODBC + if test -z "$installRemoteModule_version"; then + # https://docs.microsoft.com/it-it/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-2017 + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=3.0.1 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=5.3.0 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=5.6.1 + elif test $PHP_MAJMIN_VERSION -le 702; then + installRemoteModule_version=5.8.1 + elif test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=5.9.0 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=5.10.1 + fi + fi + ;; + ssh2) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.13 + else + installRemoteModule_version=beta + fi + fi + ;; + stomp) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.9 + fi + fi + if test "$DISTRO" = debian; then + addConfigureOption with-openssl-dir yes + else + addConfigureOption with-openssl-dir /usr + fi + ;; + swoole) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 502; then + installRemoteModule_version=1.6.10 + elif test $PHP_MAJMIN_VERSION -le 504; then + installRemoteModule_version=2.0.4 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.11 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=4.3.6 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=4.5.10 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=4.8.11 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if php --ri sockets >/dev/null 2>/dev/null; then + installRemoteModule_sockets=yes + else + installRemoteModule_sockets=no + fi + installRemoteModule_openssl=yes + case "$DISTRO_VERSION" in + alpine@3.7 | alpine@3.8) + if test -n "$installRemoteModule_version" && test $(compareVersions "$installRemoteModule_version" 4.6.0) -lt 0; then + # see https://github.com/swoole/swoole-src/issues/3934 + installRemoteModule_openssl=no + fi + ;; + esac + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + # enable brotli support? + addConfigureOption enable-brotli yes + elif test $(compareVersions "$installRemoteModule_version" 5.0.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + elif test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + # enable cares support? + addConfigureOption enable-cares yes + elif test $(compareVersions "$installRemoteModule_version" 4.6.1) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable json support? + addConfigureOption enable-swoole-json yes + # enable curl support? + addConfigureOption enable-swoole-curl yes + elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.11) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.7) -ge 0; then + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + # enable kernel debug/trace log? (it will degrade performance) + addConfigureOption enable-debug-log no + elif test $(compareVersions "$installRemoteModule_version" 4.2.6) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-debug-log no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 4.2.0) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-debug-log no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 2.1.2) -ge 0; then + # enable debug/trace log support? + addConfigureOption enable-swoole-debug no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + # enable postgresql coroutine client support? + addConfigureOption enable-coroutine-postgresql yes + elif test $(compareVersions "$installRemoteModule_version" 1.10.4) -ge 0 && test $(compareVersions "$installRemoteModule_version" 1.10.5) -le 0; then + # enable debug/trace log support? + addConfigureOption enable-swoole-debug no + # enable sockets supports? + addConfigureOption enable-sockets $installRemoteModule_sockets + # enable openssl support? + addConfigureOption enable-openssl $installRemoteModule_openssl + # enable http2 support? + addConfigureOption enable-http2 yes + # enable async-redis support? + addConfigureOption enable-async-redis yes + # enable mysqlnd support? + addConfigureOption enable-mysqlnd yes + fi + ;; + tdlib) + if ! test -f /usr/lib/libphpcpp.so || ! test -f /usr/include/phpcpp.h; then + if test $PHP_MAJMIN_VERSION -le 701; then + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/v2.1.4)" + elif test $PHP_MAJMIN_VERSION -le 703; then + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/v2.2.0)" + else + cd "$(getPackageSource https://codeload.github.com/CopernicaMarketingSoftware/PHP-CPP/tar.gz/444d1f90cf6b7f3cb5178fa0d0b5ab441b0389d0)" + fi + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + if test -z "$installRemoteModule_path"; then + installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" + git clone --depth=1 --recurse-submodules https://github.com/yaroslavche/phptdlib.git "$installRemoteModule_tmp" + mkdir "$installRemoteModule_tmp/build" + cd "$installRemoteModule_tmp/build" + cmake -D USE_SHARED_PHPCPP:BOOL=ON .. + make + make install + cd - >/dev/null + rm "$PHP_INI_DIR/conf.d/tdlib.ini" + installRemoteModule_manuallyInstalled=1 + fi + ;; + tensor) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 703; then + installRemoteModule_version=2.2.3 + fi + fi + ;; + uopz) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.0.7 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=5.0.2 + elif test $PHP_MAJMIN_VERSION -le 740; then + installRemoteModule_version=6.1.2 + fi + fi + ;; + uploadprogress) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=1.1.4 + fi + fi + ;; + uuid) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.0.5 + fi + fi + ;; + xdebug) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 500; then + installRemoteModule_version=2.0.5 + elif test $PHP_MAJMIN_VERSION -le 503; then + installRemoteModule_version=2.2.7 + elif test $PHP_MAJMIN_VERSION -le 504; then + installRemoteModule_version=2.4.1 + elif test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=2.5.5 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.6.1 + elif test $PHP_MAJMIN_VERSION -le 701; then + installRemoteModule_version=2.9.8 + elif test $PHP_MAJMIN_VERSION -le 704; then + installRemoteModule_version=3.1.6 + fi + fi + ;; + xdiff) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.5.2 + fi + fi + if ! test -f /usr/local/lib/libxdiff.* && ! test -f /usr/lib/libxdiff.* && ! test -f /usr/lib/x86_64*/libxdiff.*; then + installRemoteModule_src="$(getPackageSource https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/assets/resources/libxdiff-0.23.tar.gz)" + cd -- "$installRemoteModule_src" + ./configure --disable-shared --disable-dependency-tracking --with-pic + make -j$(getProcessorCount) + make install + cd - >/dev/null + fi + ;; + xhprof) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.9.4 + fi + fi + ;; + xlswriter) + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.2.7) -ge 0; then + # enable reader supports? + addConfigureOption enable-reader yes + fi + ;; + xmlrpc) + if test -z "$installRemoteModule_version"; then + installRemoteModule_version=beta + fi + ;; + yac) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.9.2 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 2.2.0) -ge 0; then + # Enable igbinary serializer support + if php --ri igbinary >/dev/null 2>/dev/null; then + addConfigureOption enable-igbinary yes + else + addConfigureOption enable-igbinary no + fi + # Enable json serializer support + if php --ri json >/dev/null 2>/dev/null; then + addConfigureOption enable-json yes + else + addConfigureOption enable-json no + fi + # Enable msgpack serializer support + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption enable-msgpack yes + else + addConfigureOption enable-msgpack no + fi + fi + ;; + yaml) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.3.1 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=2.0.4 + fi + fi + ;; + yar) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.2.5 + fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 1.2.4) -ge 0; then + # Enable Msgpack Supports + if php --ri msgpack >/dev/null 2>/dev/null; then + addConfigureOption enable-msgpack yes + else + addConfigureOption enable-msgpack no + fi + fi + ;; + zmq) + if test -z "$installRemoteModule_version"; then + installRemoteModule_src="$(getPackageSource https://github.com/zeromq/php-zmq/tarball/master)" + cd "$installRemoteModule_src" + phpize + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null + installRemoteModule_manuallyInstalled=1 + fi + ;; + zookeeper) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.5.0 + elif test $PHP_MAJMIN_VERSION -le 700; then + installRemoteModule_version=1.0.0 + else + installRemoteModule_version=alpha + fi + fi + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + case "$DISTRO" in + alpine) + if ! test -f /usr/local/include/zookeeper/zookeeper.h; then + if test $(compareVersions "$installRemoteModule_version" 1.0.0) -lt 0; then + installRemoteModule_src="$(getPackageSource http://archive.apache.org/dist/zookeeper/zookeeper-3.5.9/apache-zookeeper-3.5.9.tar.gz)" + else + installRemoteModule_tmp="$(curl -sSLf https://downloads.apache.org/zookeeper/stable | sed -E 's/["<>]/\n/g' | grep -E '^(apache-)?zookeeper-[0-9]+\.[0-9]+\.[0-9]+\.(tar\.gz|tgz)$' | head -n1)" + if test -z "$installRemoteModule_tmp"; then + echo 'Failed to detect the zookeeper library URL' >&2 + exit 1 + fi + installRemoteModule_src="$(getPackageSource https://downloads.apache.org/zookeeper/stable/$installRemoteModule_tmp)" + fi + cd -- "$installRemoteModule_src" + if test -d ~/.m2; then + installRemoteModule_delm2=n + else + installRemoteModule_delm2=y + fi + mvn -pl zookeeper-jute compile + cd - >/dev/null + cd -- "$installRemoteModule_src/zookeeper-client/zookeeper-client-c" + autoreconf -if + ./configure --without-cppunit + make -j$(getProcessorCount) CFLAGS='-Wno-stringop-truncation -Wno-format-overflow' + make install + cd - >/dev/null + if test $installRemoteModule_delm2 = y; then + rm -rf ~/.m2 + fi + fi + ;; + esac + ;; + zstd) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=0.11.0 + fi + fi + ;; + esac + if test $installRemoteModule_manuallyInstalled -eq 0; then + if test -n "$installRemoteModule_path"; then + printf ' (installing version %s from %s)\n' "$installRemoteModule_version" "$installRemoteModule_path" + elif test -n "$installRemoteModule_version"; then + printf ' (installing version %s)\n' "$installRemoteModule_version" + fi + installPeclPackage "$installRemoteModule_module" "$installRemoteModule_version" "$installRemoteModule_cppflags" "$installRemoteModule_path" + fi + postProcessModule "$installRemoteModule_module" + checkModuleWorking "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra" + enablePhpExtension "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra" +} + +# Check if a module/helper may be installed using the pecl archive +# +# Arguments: +# $1: the name of the module +# +# Return: +# 0: true +# 1: false +moduleMayUsePecl() { + case "$1" in + @composer | @fix_letsencrypt) + return 1 + ;; + blackfire | geos | ioncube_loader | snuffleupagus | sourceguardian | spx | tdlib) + return 1 + ;; + esac + if test -n "$(getModuleSourceCodePath "$1")"; then + return 1 + fi + if stringInList "$1" "$BUNDLED_MODULES"; then + return 1 + fi + return 0 +} + +# Configure the PECL package installer +# +# Updates: +# PHP_MODULES_TO_INSTALL +# Sets: +# USE_PICKLE 0: no, 1: yes (already downloaded), 2: yes (build it from source) +configureInstaller() { + USE_PICKLE=0 + if ! which pecl >/dev/null; then + for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do + if ! moduleMayUsePecl "$PHP_MODULE_TO_INSTALL"; then + continue + fi + if false && anyStringInList '' "$PHP_MODULES_TO_INSTALL"; then + USE_PICKLE=2 + else + curl -sSLf https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /tmp/pickle + chmod +x /tmp/pickle + USE_PICKLE=1 + fi + break + done + fi + if test $USE_PICKLE -eq 0; then + if test -z "$(pear config-get http_proxy)"; then + if test -n "${http_proxy:-}"; then + pear config-set http_proxy "$http_proxy" || true + elif test -n "${HTTP_PROXY:-}"; then + pear config-set http_proxy "$HTTP_PROXY" || true + fi + fi + pecl channel-update pecl.php.net || true + fi +} + +buildPickle() { + printf '### BUILDING PICKLE ###\n' + buildPickle_tempDir="$(mktemp -p /tmp/src -d)" + cd -- "$buildPickle_tempDir" + printf 'Downloading... ' + git clone --quiet --depth 1 https://github.com/FriendsOfPHP/pickle.git . + git tag 0.7.0 + printf 'done.\n' + printf 'Installing composer... ' + actuallyInstallComposer . composer '--1 --quiet' + printf 'done.\n' + printf 'Installing composer dependencies... ' + ./composer install --no-dev --no-progress --no-suggest --optimize-autoloader --ignore-platform-reqs --quiet --no-cache + printf 'done.\n' + printf 'Building... ' + php -d phar.readonly=0 box.phar build + mv pickle.phar /tmp/pickle + printf 'done.\n' + cd - >/dev/null +} + +# Add a configure option for the pecl/pickle install command +# +# Arguments: +# $1: the option name +# $2: the option value +addConfigureOption() { + if test $USE_PICKLE -eq 0; then + printf -- '%s\n' "$2" >>"$CONFIGURE_FILE" + else + printf -- '--%s=%s\n' "$1" "$2" >>"$CONFIGURE_FILE" + fi +} + +# Actually installs a PECL package +# +# Arguments: +# $1: the package to be installed +# $2: the package version to be installed (optional) +# $3: the value of the CPPFLAGS variable (optional) +# $4: the path of the local package to be installed (optional, downloaded from PECL if omitted/empty) +installPeclPackage() { + if ! test -f "$CONFIGURE_FILE"; then + printf '\n' >"$CONFIGURE_FILE" + fi + installPeclPackage_name="$(getPeclModuleName "$1")" + if test -z "${2:-}"; then + installPeclPackage_fullname="$installPeclPackage_name" + else + installPeclPackage_fullname="$installPeclPackage_name-$2" + fi + installPeclPackage_path="${4:-}" + if test -z "$installPeclPackage_path"; then + installPeclPackage_path="$installPeclPackage_fullname" + fi + if test $USE_PICKLE -eq 0; then + if test -n "${4:-}"; then + if test -f "$installPeclPackage_path/package2.xml"; then + installPeclPackage_path="$installPeclPackage_path/package2.xml" + else + installPeclPackage_path="$installPeclPackage_path/package.xml" + fi + fi + cat "$CONFIGURE_FILE" | MAKE="make -j$(getCompilationProcessorCount $1)" CPPFLAGS="${3:-}" pecl install "$installPeclPackage_path" + else + MAKEFLAGS="-j$(getCompilationProcessorCount $1)" CPPFLAGS="${3:-}" /tmp/pickle install --tmp-dir=/tmp/pickle.tmp --no-interaction --version-override='' --with-configure-options "$CONFIGURE_FILE" -- "$installPeclPackage_path" + fi +} + +# Check if a string is in a list of space-separated string +# +# Arguments: +# $1: the string to be checked +# $2: the string list +# +# Return: +# 0 (true): if the string is in the list +# 1 (false): if the string is not in the list +stringInList() { + for stringInList_listItem in $2; do + if test "$1" = "$stringInList_listItem"; then + return 0 + fi + done + return 1 +} + +# Check if at least one item in a list is in another list +# +# Arguments: +# $1: the space-separated list of items to be searched +# $2: the space-separated list of reference items +# +# Return: +# 0 (true): at least one of the items in $1 is in $2 +# 1 (false): otherwise +anyStringInList() { + for anyStringInList_item in $1; do + if stringInList "$anyStringInList_item" "$2"; then + return 0 + fi + done + return 1 +} + +# Remove a word from a space-separated list +# +# Arguments: +# $1: the word to be removed +# $2: the string list +# +# Output: +# The list without the word +removeStringFromList() { + removeStringFromList_result='' + for removeStringFromList_listItem in $2; do + if test "$1" != "$removeStringFromList_listItem"; then + if test -z "$removeStringFromList_result"; then + removeStringFromList_result="$removeStringFromList_listItem" + else + removeStringFromList_result="$removeStringFromList_result $removeStringFromList_listItem" + fi + fi + done + printf '%s' "$removeStringFromList_result" +} + +# Invoke apt-get update +# +# Set: +# IPE_APTGET_INSTALLOPTIONS +invokeAptGetUpdate() { + if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then + DEBIAN_FRONTEND=noninteractive apt-get update -q + return + fi + IPE_APTGET_INSTALLOPTIONS='' + if ! grep -q 'VERSION="8 (jessie)"' /etc/os-release; then + DEBIAN_FRONTEND=noninteractive apt-get update -q + return + fi + invokeAptGetUpdate_tmp="$(mktemp)" + DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + if test -s "$invokeAptGetUpdate_tmp"; then + cat "$invokeAptGetUpdate_tmp" >&2 + if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then + IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' + echo '############' >&2 + echo '# WARNING! #' >&2 + echo '############' >&2 + echo 'apt packages will be installed without checking authenticity!' >&2 + fi + fi + rm "$invokeAptGetUpdate_tmp" + IPE_APTGETUPDATE_ALREADY=y +} + +# Fix the Let's Encrypt CA certificates on old distros +fixLetsEncrypt() { + printf '### FIXING LETS ENCRYPT CA CERTIFICATES ###\n' + case "$DISTRO_VERSION" in + alpine@3.7 | alpine@3.8) + printf -- '- old Alpine Linux detected: we should fix the certificates\n' + ;; + debian@8 | debian@9) + printf -- '- old Debian detected: we should fix the certificates\n' + if ! grep -q 'mozilla/ISRG_Root_X1.crt' /etc/ca-certificates.conf && grep -q 'mozilla/DST_Root_CA_X3.crt' /etc/ca-certificates.conf; then + printf -- '- old ca-certificates package detected\n' + fixCACerts_mustUpdate=1 + if test -d /var/lib/apt/lists; then + for fixCACerts_item in $(ls -1 /var/lib/apt/lists); do + case "$fixCACerts_item" in + partial | lock) ;; + *) + fixCACerts_mustUpdate=0 + break + ;; + esac + done + fi + if test $fixCACerts_mustUpdate -eq 1; then + printf -- '- refreshing the APT package list\n' + invokeAptGetUpdate + fi + printf -- '- installing newer ca-certificates package\n' + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS ca-certificates + fi + ;; + *) + printf -- '- patch not required in this distro version\n' + return + ;; + esac + if grep -Eq '^mozilla/ISRG_Root_X1\.crt$' /etc/ca-certificates.conf && grep -Eq '^mozilla/DST_Root_CA_X3\.crt$' /etc/ca-certificates.conf; then + printf -- '- disabling the DST_Root_CA_X3 certificate\n' + sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf + printf -- '- refreshing the certificates\n' + update-ca-certificates -f + else + printf -- '- DST_Root_CA_X3 certificate not found or already disabled\n' + fi +} + +# Cleanup everything at the end of the execution +cleanup() { + if test -n "$UNNEEDED_PACKAGE_LINKS"; then + printf '### REMOVING UNNEEDED PACKAGE LINKS ###\n' + for cleanup_link in $UNNEEDED_PACKAGE_LINKS; do + if test -L "$cleanup_link"; then + rm -f "$cleanup_link" + fi + done + fi + if test -n "$PACKAGES_VOLATILE"; then + printf '### REMOVING UNNEEDED PACKAGES ###\n' + case "$DISTRO" in + alpine) + apk del --purge $PACKAGES_VOLATILE + ;; + debian) + DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + ;; + esac + fi + if test -n "$PACKAGES_PREVIOUS"; then + case "$DISTRO" in + debian) + printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' + DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + ;; + esac + fi + docker-php-source delete + rm -rf /tmp/src + rm -rf /tmp/pickle + rm -rf /tmp/pickle.tmp + rm -rf "$CONFIGURE_FILE" + case "${IPE_KEEP_SYSPKG_CACHE:-}" in + 1 | y* | Y*) ;; + *) + case "$DISTRO" in + alpine) + rm -rf /var/cache/apk/* + ;; + debian) + rm -rf /var/lib/apt/lists/* + ;; + esac + rm -rf /tmp/pear + ;; + esac +} + +resetIFS +mkdir -p /tmp/src +mkdir -p /tmp/pickle.tmp +IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)" +CONFIGURE_FILE=/tmp/configure-options +IPE_APK_FLAGS='' +setDistro +case "$DISTRO_VERSION" in + debian@8) + fixMaxOpenFiles || true + ;; +esac +setPHPVersionVariables +setPHPPreinstalledModules +case "$PHP_MAJMIN_VERSION" in + 505 | 506 | 700 | 701 | 702 | 703 | 704 | 800 | 801 | 802) ;; + *) + printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100)) + ;; +esac +UNNEEDED_PACKAGE_LINKS='' +processCommandArguments "$@" + +if test -z "$PHP_MODULES_TO_INSTALL"; then + exit 0 +fi + +if stringInList @fix_letsencrypt "$PHP_MODULES_TO_INSTALL"; then + # This must be the very first thing we do + fixLetsEncrypt +fi + +sortModulesToInstall + +docker-php-source extract +BUNDLED_MODULES="$(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | xargs -n1 dirname | xargs -n1 basename | xargs)" +configureInstaller + +buildRequiredPackageLists $PHP_MODULES_TO_INSTALL +if test -n "$PACKAGES_PERSISTENT_PRE"; then + markPreinstalledPackagesAsUsed +fi +if test -n "$PACKAGES_PERSISTENT_NEW$PACKAGES_VOLATILE"; then + installRequiredPackages +fi +if test "$PHP_MODULES_TO_INSTALL" != '@composer'; then + setTargetTriplet +fi +if test $USE_PICKLE -gt 1; then + buildPickle +fi +for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do + case "$PHP_MODULE_TO_INSTALL" in + @fix_letsencrypt) + # Already done: it must be the first thing we do + ;; + @composer) + installComposer + ;; + *) + if stringInList "$PHP_MODULE_TO_INSTALL" "$BUNDLED_MODULES"; then + installBundledModule "$PHP_MODULE_TO_INSTALL" + else + installRemoteModule "$PHP_MODULE_TO_INSTALL" + fi + ;; + esac +done +cleanup diff --git a/apps/php8/versions/8.2.0/build/php/extensions/install.sh b/apps/php8/versions/8.2.0/build/php/extensions/install.sh new file mode 100644 index 00000000..c05abc63 --- /dev/null +++ b/apps/php8/versions/8.2.0/build/php/extensions/install.sh @@ -0,0 +1,692 @@ +#!/bin/sh + +export MC="-j$(nproc)" + +echo +echo "============================================" +echo "Install extensions from : install.sh" +echo "PHP version : ${PHP_VERSION}" +echo "Extra Extensions : ${PHP_EXTENSIONS}" +echo "Multicore Compilation : ${MC}" +echo "Container package url : ${CONTAINER_PACKAGE_URL}" +echo "Work directory : ${PWD}" +echo "============================================" +echo + + +if [ "${PHP_EXTENSIONS}" != "" ]; then + apk --update add --no-cache --virtual .build-deps autoconf g++ libtool make curl-dev gettext-dev linux-headers +fi + + +export EXTENSIONS=",${PHP_EXTENSIONS}," + + +# +# Check if current php version is greater than or equal to +# specific version. +# +# For example, to check if current php is greater than or +# equal to PHP 8.0: +# +# isPhpVersionGreaterOrEqual 8 0 +# +# Param 1: Specific PHP Major version +# Param 2: Specific PHP Minor version +# Return : 1 if greater than or equal to, 0 if less than +# +isPhpVersionGreaterOrEqual() + { + local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;") + local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;") + + if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then + return 1; + else + return 0; + fi +} + + +# +# Install extension from package file(.tgz), +# For example: +# +# installExtensionFromTgz redis-5.2.2 +# +# Param 1: Package name with version +# Param 2: enable options +# +installExtensionFromTgz() +{ + tgzName=$1 + para1= + extensionName="${tgzName%%-*}" + if [ $2 ]; then + para1=$2 + fi + mkdir ${extensionName} + tar -xf ${tgzName}.tgz -C ${extensionName} --strip-components=1 + ( cd ${extensionName} && phpize && ./configure ${para1} && make ${MC} && make install ) + + docker-php-ext-enable ${extensionName} +} + + +if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then + echo "---------- Install pdo_mysql ----------" + docker-php-ext-install ${MC} pdo_mysql +fi + +if [[ -z "${EXTENSIONS##*,pcntl,*}" ]]; then + echo "---------- Install pcntl ----------" + docker-php-ext-install ${MC} pcntl +fi + +if [[ -z "${EXTENSIONS##*,mysqli,*}" ]]; then + echo "---------- Install mysqli ----------" + docker-php-ext-install ${MC} mysqli +fi + +if [[ -z "${EXTENSIONS##*,mbstring,*}" ]]; then + echo "---------- mbstring is installed ----------" +fi + +if [[ -z "${EXTENSIONS##*,exif,*}" ]]; then + echo "---------- Install exif ----------" + docker-php-ext-install ${MC} exif +fi + +if [[ -z "${EXTENSIONS##*,bcmath,*}" ]]; then + echo "---------- Install bcmath ----------" + docker-php-ext-install ${MC} bcmath +fi + +if [[ -z "${EXTENSIONS##*,calendar,*}" ]]; then + echo "---------- Install calendar ----------" + docker-php-ext-install ${MC} calendar +fi + +if [[ -z "${EXTENSIONS##*,zend_test,*}" ]]; then + echo "---------- Install zend_test ----------" + docker-php-ext-install ${MC} zend_test +fi + +if [[ -z "${EXTENSIONS##*,opcache,*}" ]]; then + echo "---------- Install opcache ----------" + docker-php-ext-install opcache +fi + +if [[ -z "${EXTENSIONS##*,sockets,*}" ]]; then + echo "---------- Install sockets ----------" + docker-php-ext-install ${MC} sockets +fi + +if [[ -z "${EXTENSIONS##*,gettext,*}" ]]; then + echo "---------- Install gettext ----------" + apk --no-cache add gettext-dev + docker-php-ext-install ${MC} gettext + +fi + +if [[ -z "${EXTENSIONS##*,shmop,*}" ]]; then + echo "---------- Install shmop ----------" + docker-php-ext-install ${MC} shmop +fi + +if [[ -z "${EXTENSIONS##*,sysvmsg,*}" ]]; then + echo "---------- Install sysvmsg ----------" + docker-php-ext-install ${MC} sysvmsg +fi + +if [[ -z "${EXTENSIONS##*,sysvsem,*}" ]]; then + echo "---------- Install sysvsem ----------" + docker-php-ext-install ${MC} sysvsem +fi + +if [[ -z "${EXTENSIONS##*,sysvshm,*}" ]]; then + echo "---------- Install sysvshm ----------" + docker-php-ext-install ${MC} sysvshm +fi + +if [[ -z "${EXTENSIONS##*,pdo_firebird,*}" ]]; then + echo "---------- Install pdo_firebird ----------" + docker-php-ext-install ${MC} pdo_firebird +fi + +if [[ -z "${EXTENSIONS##*,pdo_dblib,*}" ]]; then + echo "---------- Install pdo_dblib ----------" + docker-php-ext-install ${MC} pdo_dblib +fi + +if [[ -z "${EXTENSIONS##*,pdo_oci,*}" ]]; then + echo "---------- Install pdo_oci ----------" + docker-php-ext-install ${MC} pdo_oci +fi + +if [[ -z "${EXTENSIONS##*,pdo_odbc,*}" ]]; then + echo "---------- Install pdo_odbc ----------" + docker-php-ext-install ${MC} pdo_odbc +fi + +if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then + echo "---------- Install pdo_pgsql ----------" + apk --no-cache add postgresql-dev \ + && docker-php-ext-install ${MC} pdo_pgsql +fi + +if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then + echo "---------- Install pgsql ----------" + apk --no-cache add postgresql-dev \ + && docker-php-ext-install ${MC} pgsql +fi + +if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then + echo "---------- Install oci8 ----------" + docker-php-ext-install ${MC} oci8 +fi + +if [[ -z "${EXTENSIONS##*,odbc,*}" ]]; then + echo "---------- Install odbc ----------" + docker-php-ext-install ${MC} odbc +fi + +if [[ -z "${EXTENSIONS##*,dba,*}" ]]; then + echo "---------- Install dba ----------" + docker-php-ext-install ${MC} dba +fi + +if [[ -z "${EXTENSIONS##*,interbase,*}" ]]; then + echo "---------- Install interbase ----------" + echo "Alpine linux do not support interbase/firebird!!!" + #docker-php-ext-install ${MC} interbase +fi + +if [[ -z "${EXTENSIONS##*,hprose,*}" ]]; then + echo "---------- Install hprose ----------" + printf "\n" | pecl install hprose + docker-php-ext-enable hprose +fi + +if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then + echo "---------- 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 + + apk add --no-cache \ + freetype \ + freetype-dev \ + libpng \ + libpng-dev \ + libjpeg-turbo \ + libjpeg-turbo-dev \ + libwebp-dev \ + && docker-php-ext-configure gd ${options} \ + && docker-php-ext-install ${MC} gd \ + && apk del \ + freetype-dev \ + libpng-dev \ + libjpeg-turbo-dev +fi + +if [[ -z "${EXTENSIONS##*,yaml,*}" ]]; then + echo "---------- Install yaml ----------" + apk add --no-cache yaml-dev + printf "\n" | pecl install yaml + docker-php-ext-enable yaml +fi + +if [[ -z "${EXTENSIONS##*,intl,*}" ]]; then + echo "---------- Install intl ----------" + apk add --no-cache icu-dev + docker-php-ext-install ${MC} intl +fi + +if [[ -z "${EXTENSIONS##*,bz2,*}" ]]; then + echo "---------- Install bz2 ----------" + apk add --no-cache bzip2-dev + docker-php-ext-install ${MC} bz2 +fi + +if [[ -z "${EXTENSIONS##*,soap,*}" ]]; then + echo "---------- Install soap ----------" + apk add --no-cache libxml2-dev + docker-php-ext-install ${MC} soap +fi + +if [[ -z "${EXTENSIONS##*,xsl,*}" ]]; then + echo "---------- Install xsl ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} xsl +fi + +if [[ -z "${EXTENSIONS##*,xmlrpc,*}" ]]; then + echo "---------- Install xmlrpc ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} xmlrpc +fi + +if [[ -z "${EXTENSIONS##*,wddx,*}" ]]; then + echo "---------- Install wddx ----------" + apk add --no-cache libxml2-dev libxslt-dev + docker-php-ext-install ${MC} wddx +fi + +if [[ -z "${EXTENSIONS##*,curl,*}" ]]; then + echo "---------- curl is installed ----------" +fi + +if [[ -z "${EXTENSIONS##*,readline,*}" ]]; then + echo "---------- Install readline ----------" + apk add --no-cache readline-dev + apk add --no-cache libedit-dev + docker-php-ext-install ${MC} readline +fi + +if [[ -z "${EXTENSIONS##*,snmp,*}" ]]; then + echo "---------- Install snmp ----------" + apk add --no-cache net-snmp-dev + docker-php-ext-install ${MC} snmp +fi + +if [[ -z "${EXTENSIONS##*,pspell,*}" ]]; then + echo "---------- Install pspell ----------" + apk add --no-cache aspell-dev + apk add --no-cache aspell-en + docker-php-ext-install ${MC} pspell +fi + +if [[ -z "${EXTENSIONS##*,recode,*}" ]]; then + echo "---------- Install recode ----------" + apk add --no-cache recode-dev + docker-php-ext-install ${MC} recode +fi + +if [[ -z "${EXTENSIONS##*,tidy,*}" ]]; then + echo "---------- Install tidy ----------" + apk add --no-cache tidyhtml-dev + + # Fix: https://github.com/htacg/tidy-html5/issues/235 + ln -s /usr/include/tidybuffio.h /usr/include/buffio.h + + docker-php-ext-install ${MC} tidy +fi + +if [[ -z "${EXTENSIONS##*,gmp,*}" ]]; then + echo "---------- Install gmp ----------" + apk add --no-cache gmp-dev + docker-php-ext-install ${MC} gmp +fi + +if [[ -z "${EXTENSIONS##*,imap,*}" ]]; then + echo "---------- Install imap ----------" + apk add --no-cache imap-dev + docker-php-ext-configure imap --with-imap --with-imap-ssl + docker-php-ext-install ${MC} imap +fi + +if [[ -z "${EXTENSIONS##*,ldap,*}" ]]; then + echo "---------- Install ldap ----------" + apk add --no-cache ldb-dev + apk add --no-cache openldap-dev + docker-php-ext-install ${MC} ldap +fi + +if [[ -z "${EXTENSIONS##*,psr,*}" ]]; then + echo "---------- Install psr ----------" + printf "\n" | pecl install psr + docker-php-ext-enable psr +fi + +if [[ -z "${EXTENSIONS##*,imagick,*}" ]]; then + echo "---------- Install imagick ----------" + apk add --no-cache file-dev + apk add --no-cache imagemagick-dev + printf "\n" | pecl install imagick-3.4.4 + docker-php-ext-enable imagick +fi + +if [[ -z "${EXTENSIONS##*,rar,*}" ]]; then + echo "---------- Install rar ----------" + printf "\n" | pecl install rar + docker-php-ext-enable rar +fi + +if [[ -z "${EXTENSIONS##*,ast,*}" ]]; then + echo "---------- Install ast ----------" + printf "\n" | pecl install ast + docker-php-ext-enable ast +fi + +if [[ -z "${EXTENSIONS##*,msgpack,*}" ]]; then + echo "---------- Install msgpack ----------" + printf "\n" | pecl install msgpack + docker-php-ext-enable msgpack +fi + +if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then + echo "---------- Install igbinary ----------" + printf "\n" | pecl install igbinary + docker-php-ext-enable igbinary +fi + + +if [[ -z "${EXTENSIONS##*,ssh2,*}" ]]; then + isPhpVersionGreaterOrEqual 8 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 >= 8.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install protobuf ----------" + printf "\n" | pecl install protobuf + docker-php-ext-enable protobuf + else + echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then + isPhpVersionGreaterOrEqual 8 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 >= 8.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install yar ----------" + printf "\n" | pecl install yar + docker-php-ext-enable yar + else + echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + fi + +fi + + + +if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install yaconf ----------" + printf "\n" | pecl install yaconf + docker-php-ext-enable yaconf + else + echo "yar requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,seaslog,*}" ]]; then + echo "---------- Install seaslog ----------" + printf "\n" | pecl install seaslog + docker-php-ext-enable seaslog +fi + +if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then + echo "---------- Install varnish ----------" + apk add --no-cache varnish-dev + printf "\n" | pecl install varnish + docker-php-ext-enable varnish +fi + +if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install pdo_sqlsrv ----------" + apk add --no-cache unixodbc-dev + printf "\n" | pecl install pdo_sqlsrv + docker-php-ext-enable pdo_sqlsrv + curl -o /tmp/msodbcsql17_amd64.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk + apk add --allow-untrusted /tmp/msodbcsql17_amd64.apk + else + echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,sqlsrv,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install sqlsrv ----------" + apk add --no-cache unixodbc-dev + printf "\n" | pecl install sqlsrv + docker-php-ext-enable sqlsrv + else + echo "pdo_sqlsrv requires PHP >= 8.0.0, installed version is ${PHP_VERSION}" + fi +fi + +if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo "---------- Install mcrypt ----------" + apk add --no-cache libmcrypt-dev libmcrypt re2c + printf "\n" |pecl install mcrypt + docker-php-ext-enable mcrypt + else + echo "---------- Install mcrypt ----------" + apk add --no-cache libmcrypt-dev \ + && docker-php-ext-install ${MC} mcrypt + fi +fi + +if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + + if [[ "$?" = "1" ]]; then + echo "---------- mysql was REMOVED from PHP 8.0.0 ----------" + else + echo "---------- Install mysql ----------" + docker-php-ext-install ${MC} mysql + fi +fi + +if [[ -z "${EXTENSIONS##*,sodium,*}" ]]; then + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + echo + echo "Sodium is bundled with PHP from PHP 8.0.0" + echo + else + echo "---------- Install sodium ----------" + apk add --no-cache libsodium-dev + docker-php-ext-install ${MC} sodium + fi +fi + +if [[ -z "${EXTENSIONS##*,amqp,*}" ]]; then + echo "---------- Install amqp ----------" + apk add --no-cache -U autoconf + apk add --no-cache -U gcc + apk add --no-cache -U linux-headers + apk add --no-cache -U libc-dev + + apk add --no-cache --update --virtual .phpize-deps-configure $PHPIZE_DEPS \ + && apk add rabbitmq-c-dev \ + && printf '\n' | pecl install amqp \ + && docker-php-ext-enable amqp \ + && apk del .phpize-deps-configure + +fi + +if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then + echo "---------- Install redis ----------" + installExtensionFromTgz redis-5.3.7 +fi + +if [[ -z "${EXTENSIONS##*,apcu,*}" ]]; then + echo "---------- Install apcu ----------" + pecl install apcu + docker-php-ext-enable apcu +fi + +if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then + echo "---------- Install memcached ----------" + apk add --no-cache libmemcached-dev zlib-dev + pecl install memcached-3.2.3 + docker-php-ext-enable memcached +fi + +if [[ -z "${EXTENSIONS##*,memcache,*}" ]]; then + echo "---------- Install memcache ----------" + pecl install memcache + docker-php-ext-enable memcache +fi + +if [[ -z "${EXTENSIONS##*,xdebug,*}" ]]; then + echo "---------- Install xdebug ----------" + installExtensionFromTgz xdebug-3.2.0 +fi + +if [[ -z "${EXTENSIONS##*,event,*}" ]]; then + echo "---------- Install event ----------" + apk add --no-cache libevent-dev + export is_sockets_installed=$(php -r "echo extension_loaded('sockets');") + + if [[ "${is_sockets_installed}" = "" ]]; then + echo "---------- event is depend on sockets, install sockets first ----------" + docker-php-ext-install sockets + fi + + echo "---------- Install event again ----------" + installExtensionFromTgz event-3.0.5 "--ini-name event.ini" +fi + +if [[ -z "${EXTENSIONS##*,mongodb,*}" ]]; then + echo "---------- Install mongodb ----------" + pecl install mongodb + docker-php-ext-enable mongodb +fi + +if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then + echo "---------- Install yaf ----------" + pecl install yaf + docker-php-ext-enable yaf +fi + + +if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then + echo "---------- Install swoole ----------" + isPhpVersionGreaterOrEqual 8 0 + if [[ "$?" = "1" ]]; then + installExtensionFromTgz swoole-5.0.2 --enable-openssl + 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 + + isPhpVersionGreaterOrEqual 8 0 + 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 ----------" + pecl install xhprof + docker-php-ext-enable xhprof + +fi + +if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then + echo "---------- Install xlswriter ----------" + isPhpVersionGreaterOrEqual 8 0 + + if [[ "$?" = "1" ]]; then + printf "\n" | pecl install xlswriter + docker-php-ext-enable xlswriter + else + echo "---------- PHP Version>= 8.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,rdkafka,*}" ]]; then + echo "---------- Install rdkafka ----------" + isPhpVersionGreaterOrEqual 8 0 + + if [[ "$?" = "1" ]]; then + apk add librdkafka-dev + printf "\n" | pecl install rdkafka + docker-php-ext-enable rdkafka + else + echo "---------- PHP Version>= 8.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,zookeeper,*}" ]]; then + echo "---------- Install zookeeper ----------" + isPhpVersionGreaterOrEqual 8 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>= 8.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,phalcon,*}" ]]; then + echo "---------- Install phalcon ----------" + isPhpVersionGreaterOrEqual 8 0 + + if [[ "$?" = "1" ]]; then + printf "\n" | pecl install phalcon + docker-php-ext-enable psr + docker-php-ext-enable phalcon + else + echo "---------- PHP Version>= 8.0----------" + fi +fi + +if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then + echo "---------- Install sdebug ----------" + isPhpVersionGreaterOrEqual 8 0 + + if [[ "$?" = "1" ]]; then + curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \ + && mkdir -p sdebug \ + && tar -xf sdebug.tar.gz -C sdebug --strip-components=1 \ + && rm sdebug.tar.gz \ + && ( \ + cd sdebug \ + && phpize \ + && ./configure --enable-xdebug \ + && make clean && make && make install \ + ) \ + && docker-php-ext-enable xdebug + else + echo "---------- PHP Version>= 8.0----------" + fi +fi + +if [ "${PHP_EXTENSIONS}" != "" ]; then + apk del .build-deps \ + && docker-php-source delete +fi diff --git a/apps/php8/versions/8.2.0/build/php/extensions/redis-5.3.7.tgz b/apps/php8/versions/8.2.0/build/php/extensions/redis-5.3.7.tgz new file mode 100644 index 00000000..db2187b4 Binary files /dev/null and b/apps/php8/versions/8.2.0/build/php/extensions/redis-5.3.7.tgz differ diff --git a/apps/php8/versions/8.2.0/build/php/extensions/swoole-5.0.2.tgz b/apps/php8/versions/8.2.0/build/php/extensions/swoole-5.0.2.tgz new file mode 100644 index 00000000..7e42418c Binary files /dev/null and b/apps/php8/versions/8.2.0/build/php/extensions/swoole-5.0.2.tgz differ diff --git a/apps/php8/versions/8.2.0/build/php/extensions/xdebug-3.2.0.tgz b/apps/php8/versions/8.2.0/build/php/extensions/xdebug-3.2.0.tgz new file mode 100644 index 00000000..4023612c Binary files /dev/null and b/apps/php8/versions/8.2.0/build/php/extensions/xdebug-3.2.0.tgz differ diff --git a/apps/php8/versions/8.2.0/build/php/php-fpm.conf b/apps/php8/versions/8.2.0/build/php/php-fpm.conf new file mode 100644 index 00000000..13183589 --- /dev/null +++ b/apps/php8/versions/8.2.0/build/php/php-fpm.conf @@ -0,0 +1,423 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or NONE) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = www-data +;listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 10 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/local/share/php/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +slowlog = /var/log/php/fpm.slow.log + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_slowlog_timeout = 3 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr/local) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/apps/php8/versions/8.2.0/build/php/php.ini b/apps/php8/versions/8.2.0/build/php/php.ini new file mode 100644 index 00000000..fa9437bc --- /dev/null +++ b/apps/php8/versions/8.2.0/build/php/php.ini @@ -0,0 +1,1933 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 256M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +error_log = /var/log/php/php.error.log + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 100M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 50M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Asia/Shanghai + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: + +[XDebug] +xdebug.mode=debug +xdebug.remote_handler = "dbgp" +; Set to host.docker.internal on Mac and Windows, otherwise, set to host real ip +xdebug.client_host = host.docker.internal +;xdebug.remote_port = 9000 +xdebug.remote_log = /var/log/php/xdebug.log + +SERVER_ENV=develop + +yaf.use_spl_autoload=1 + +[xhprof] +;xhprof.output_dir = /var/log/php/xhprof.log \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/conf/php-fpm.conf b/apps/php8/versions/8.2.0/conf/php-fpm.conf new file mode 100644 index 00000000..13183589 --- /dev/null +++ b/apps/php8/versions/8.2.0/conf/php-fpm.conf @@ -0,0 +1,423 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or NONE) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = www-data +group = www-data + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = www-data +;listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 10 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/local/share/php/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +slowlog = /var/log/php/fpm.slow.log + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_slowlog_timeout = 3 + +; Depth of slow log stack trace. +; Default Value: 20 +;request_slowlog_trace_depth = 20 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr/local) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/apps/php8/versions/8.2.0/conf/php.ini b/apps/php8/versions/8.2.0/conf/php.ini new file mode 100644 index 00000000..30535103 --- /dev/null +++ b/apps/php8/versions/8.2.0/conf/php.ini @@ -0,0 +1,1933 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 256M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +error_log = /var/log/php/php.error.log + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 100M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 50M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +date.timezone = Asia/Shanghai + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: + +[XDebug] +xdebug.remote_enable = 1 +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/xdebug.log + +SERVER_ENV=develop + +yaf.use_spl_autoload=1 + +[xhprof] +;xhprof.output_dir = /var/log/php/xhprof.log \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/config.json b/apps/php8/versions/8.2.0/config.json new file mode 100644 index 00000000..f6f66c97 --- /dev/null +++ b/apps/php8/versions/8.2.0/config.json @@ -0,0 +1,13 @@ +{ + "formFields": [ + { + "type": "number", + "labelZh": "端口", + "labelEn": "Port", + "required": true, + "default": 9000, + "rule": "paramPort", + "envKey": "PANEL_APP_PORT_HTTP" + } + ] +} \ No newline at end of file diff --git a/apps/php8/versions/8.2.0/docker-compose.yml b/apps/php8/versions/8.2.0/docker-compose.yml new file mode 100644 index 00000000..6e019077 --- /dev/null +++ b/apps/php8/versions/8.2.0/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3" +services: + php: + image: ${IMAGE_NAME} + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + volumes: + - ${PANEL_WEBSITE_DIR}:/www/ + - ./conf/php.ini:/usr/local/etc/php/php.ini + - ./conf/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf + - ./log:/var/log/php + - ./composer:/tmp/composer + ports: + - ${PANEL_APP_PORT_HTTP}:9000 +networks: + 1panel-network: + external: true \ No newline at end of file