diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 500cfff9a..0781583ce 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -30,6 +30,22 @@ jobs: tag: "8.3" image_name: "php-83" + - dockerfile: "8.4/Dockerfile.fedora" + docker_context: "8.4" + registry_namespace: "fedora" + quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" + tag: "8.4" + image_name: "php-84" + + - dockerfile: "8.4/Dockerfile.c10s" + docker_context: "8.4" + registry_namespace: "sclorg" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + tag: "c10s" + image_name: "php-84-c10s" + - dockerfile: "8.3/Dockerfile.c10s" docker_context: "8.3" registry_namespace: "sclorg" diff --git a/8.3/test/examples b/8.3/test/examples index da7b19653..d15735c1d 120000 --- a/8.3/test/examples +++ b/8.3/test/examples @@ -1 +1 @@ -../../examples/ \ No newline at end of file +../../examples \ No newline at end of file diff --git a/8.3/test/imagestreams b/8.3/test/imagestreams index 0dcbe9e02..7a0aee9c8 120000 --- a/8.3/test/imagestreams +++ b/8.3/test/imagestreams @@ -1 +1 @@ -../../imagestreams/ \ No newline at end of file +../../imagestreams \ No newline at end of file diff --git a/8.3/test/self-signed-ssl b/8.3/test/self-signed-ssl index 1c1fd1874..d821c11d6 120000 --- a/8.3/test/self-signed-ssl +++ b/8.3/test/self-signed-ssl @@ -1 +1 @@ -../../examples/self-signed-ssl/ \ No newline at end of file +../../examples/self-signed-ssl \ No newline at end of file diff --git a/8.3/test/test-app b/8.3/test/test-app index e90082861..6ba4f2907 120000 --- a/8.3/test/test-app +++ b/8.3/test/test-app @@ -1 +1 @@ -../../test/test-app/ \ No newline at end of file +../../test/test-app \ No newline at end of file diff --git a/8.4/.exclude-c9s b/8.4/.exclude-c9s new file mode 100644 index 000000000..e69de29bb diff --git a/8.4/.exclude-rhel9 b/8.4/.exclude-rhel9 new file mode 100644 index 000000000..e69de29bb diff --git a/8.4/Dockerfile.c10s b/8.4/Dockerfile.c10s new file mode 100644 index 000000000..8888b74bc --- /dev/null +++ b/8.4/Dockerfile.c10s @@ -0,0 +1,92 @@ +FROM quay.io/sclorg/s2i-base-c10s:c10s + +# This image provides an Apache+PHP environment for running PHP +# applications. + +EXPOSE 8080 +EXPOSE 8443 + +# Description +# This image provides an Apache 2.4 + PHP 8.4 environment for running PHP applications. +# Exposed ports: +# * 8080 - alternative port for http + +ENV PHP_VERSION=8.4 \ + PHP_VER_SHORT=84 \ + NAME=php + +ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \ + DESCRIPTION="PHP $PHP_VERSION available as container is a base platform for \ +building and running various PHP $PHP_VERSION applications and frameworks. \ +PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers \ +to write dynamically generated web pages. PHP also offers built-in database integration \ +for several commercial and non-commercial database management systems, so writing \ +a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \ +is probably as a replacement for CGI scripts." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Apache 2.4 with PHP ${PHP_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},${NAME}-${PHP_VER_SHORT}" \ + io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ + io.s2i.scripts-url="image:///usr/libexec/s2i" \ + name="sclorg/${NAME}-${PHP_VER_SHORT}-c10s" \ + com.redhat.component="${NAME}-${PHP_VER_SHORT}-container" \ + version="1" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ + usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app sclorg/${NAME}-${PHP_VER_SHORT}-c10s sample-server" \ + maintainer="SoftwareCollections.org " + +# Install Apache httpd and PHP +ARG INSTALL_PKGS="php${PHP_VERSION} php${PHP_VERSION}-fpm mod_ssl hostname" +ARG INSTALL_EXTS="php${PHP_VERSION}-mysqlnd php${PHP_VERSION}-pgsql php${PHP_VERSION}-bcmath \ + php${PHP_VERSION}-gd php${PHP_VERSION}-intl php${PHP_VERSION}-ldap php${PHP_VERSION}-mbstring php${PHP_VERSION}-pdo \ + php${PHP_VERSION}-process php${PHP_VERSION}-soap php${PHP_VERSION}-xml \ + php${PHP_VERSION}-gmp" +ARG INSTALL_EXTS_PECL="php${PHP_VERSION}-pecl-apcu php${PHP_VERSION}-pecl-zip php${PHP_VERSION}-pecl-redis6" + +RUN dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS $INSTALL_EXTS $INSTALL_EXTS_PECL && \ + dnf reinstall -y tzdata && \ + rpm -V $INSTALL_PKGS && \ + php -v | grep -qe "v$PHP_VERSION\." && \ + echo "Found VERSION $PHP_VERSION" && \ + for ext in $(echo $INSTALL_EXTS | sed s/php${PHP_VERSION}-//g) ; do php -m | grep -qi "$ext"; done && \ + for ext in $(echo $INSTALL_EXTS_PECL | sed s/php${PHP_VERSION}-pecl-//g | sed s/redis6/redis/g) ; do php -m | grep -qi "$ext"; done && \ + echo "Found requested extensions" && \ + dnf -y clean all --enablerepo='*' + +ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \ + APP_DATA=${APP_ROOT}/src \ + PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \ + PHP_SYSCONF_PATH=/etc \ + PHP_HTTPD_CONF_FILE=php.conf \ + PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \ + PHP_FPM_CONF_FILE=www.conf \ + PHP_FPM_RUN_DIR=/run/php-fpm \ + PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \ + PHP_FPM_LOG_PATH=/var/log/php-fpm \ + HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \ + HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ + HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ + HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \ + HTTPD_VAR_RUN=/var/run/httpd \ + HTTPD_DATA_PATH=/var/www \ + HTTPD_DATA_ORIG_PATH=/var/www \ + HTTPD_VAR_PATH=/var + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY ./s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY ./root/ / + +# Reset permissions of filesystem to default values +RUN /usr/libexec/container-setup && rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image +CMD $STI_SCRIPTS_PATH/usage diff --git a/8.4/Dockerfile.c9s b/8.4/Dockerfile.c9s new file mode 100644 index 000000000..d649ca5a7 --- /dev/null +++ b/8.4/Dockerfile.c9s @@ -0,0 +1,91 @@ +FROM quay.io/sclorg/s2i-base-c9s:c9s + +# This image provides an Apache+PHP environment for running PHP +# applications. + +EXPOSE 8080 +EXPOSE 8443 + +# Description +# This image provides an Apache 2.4 + PHP 8.4 environment for running PHP applications. +# Exposed ports: +# * 8080 - alternative port for http + +ENV PHP_VERSION=8.4 \ + PHP_VER_SHORT=84 \ + NAME=php + +ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \ + DESCRIPTION="PHP $PHP_VERSION available as container is a base platform for \ +building and running various PHP $PHP_VERSION applications and frameworks. \ +PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers \ +to write dynamically generated web pages. PHP also offers built-in database integration \ +for several commercial and non-commercial database management systems, so writing \ +a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \ +is probably as a replacement for CGI scripts." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Apache 2.4 with PHP ${PHP_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},${NAME}-${PHP_VER_SHORT}" \ + io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ + io.s2i.scripts-url="image:///usr/libexec/s2i" \ + name="sclorg/${NAME}-${PHP_VER_SHORT}-c9s" \ + com.redhat.component="${NAME}-${PHP_VER_SHORT}-container" \ + version="1" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ + usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app sclorg/${NAME}-${PHP_VER_SHORT}-c9s sample-server" \ + maintainer="SoftwareCollections.org " + +# Install Apache httpd and PHP +ARG INSTALL_PKGS="php php-fpm mod_ssl hostname" +ARG INSTALL_EXTS="php-json php-mysqli php-pgsql php-bcmath \ + php-gd php-intl php-ldap php-mbstring php-pdo \ + php-process php-soap php-opcache php-xml \ + php-gmp php-apcu php-zip php-redis" + +RUN dnf module -y enable php:$PHP_VERSION && \ + dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS $INSTALL_EXTS && \ + dnf reinstall -y tzdata && \ + rpm -V $INSTALL_PKGS && \ + php -v | grep -qe "v$PHP_VERSION\." && \ + echo "Found VERSION $PHP_VERSION" && \ + for ext in $(echo $INSTALL_EXTS | sed s/php-//g) ; do php -m | grep -qi "$ext\$"; done && \ + echo "Found requested extensions" && \ + dnf -y clean all --enablerepo='*' + +ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \ + APP_DATA=${APP_ROOT}/src \ + PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \ + PHP_SYSCONF_PATH=/etc \ + PHP_HTTPD_CONF_FILE=php.conf \ + PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \ + PHP_FPM_CONF_FILE=www.conf \ + PHP_FPM_RUN_DIR=/run/php-fpm \ + PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \ + PHP_FPM_LOG_PATH=/var/log/php-fpm \ + HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \ + HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ + HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ + HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \ + HTTPD_VAR_RUN=/var/run/httpd \ + HTTPD_DATA_PATH=/var/www \ + HTTPD_DATA_ORIG_PATH=/var/www \ + HTTPD_VAR_PATH=/var + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY ./s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY ./root/ / + +# Reset permissions of filesystem to default values +RUN /usr/libexec/container-setup && rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image +CMD $STI_SCRIPTS_PATH/usage diff --git a/8.4/Dockerfile.fedora b/8.4/Dockerfile.fedora new file mode 100644 index 000000000..5daabdd97 --- /dev/null +++ b/8.4/Dockerfile.fedora @@ -0,0 +1,85 @@ +FROM quay.io/fedora/s2i-base:43 + +# This image provides an Apache+PHP environment for running PHP +# applications. + +EXPOSE 8080 +EXPOSE 8443 + +ENV PHP_VERSION=8.4 \ + PHP_SHORT_VER=84 \ + PATH=$PATH:/usr/bin + +ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \ + DESCRIPTION="PHP $PHP_VERSION available as container is a base platform for \ +building and running various PHP $PHP_VERSION applications and frameworks. \ +PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers \ +to write dynamically generated web pages. PHP also offers built-in database integration \ +for several commercial and non-commercial database management systems, so writing \ +a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \ +is probably as a replacement for CGI scripts." + +ENV NAME=php \ + VERSION=0 \ + RELEASE=1 \ + ARCH=x86_64 + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Apache 2.4 with PHP $PHP_VERSION" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,php" \ + name="fedora/$NAME-$PHP_SHORT_VER" \ + com.redhat.component="$NAME" \ + version="$VERSION" \ + usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=/$PHP_VERSION/test/test-app quay.io/fedora/$NAME-$PHP_SHORT_VER sample-server" \ + maintainer="SoftwareCollections.org " + +# Install Apache httpd and PHP +ARG INSTALL_PKGS="php php-fpm mod_ssl hostname" +ARG INSTALL_EXTS="php-json php-mysqli php-pgsql php-bcmath \ + php-gd php-intl php-ldap php-mbstring php-pdo \ + php-process php-soap php-opcache php-xml \ + php-gmp php-apcu php-zip php-redis" + +RUN dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS $INSTALL_EXTS --nogpgcheck && \ + rpm -V $INSTALL_PKGS && \ + php -v | grep -qe "v$PHP_VERSION\." && \ + echo "Found VERSION $PHP_VERSION" && \ + for ext in $(echo $INSTALL_EXTS | sed s/php-//g) ; do php -m | grep -qi "$ext\$"; done && \ + echo "Found requested extensions" && \ + dnf -y clean all --enablerepo='*' + +ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \ + APP_DATA=${APP_ROOT}/src \ + PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \ + PHP_SYSCONF_PATH=/etc \ + PHP_HTTPD_CONF_FILE=php.conf \ + PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \ + PHP_FPM_CONF_FILE=www.conf \ + PHP_FPM_RUN_DIR=/run/php-fpm \ + PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \ + PHP_FPM_LOG_PATH=/var/log/php-fpm \ + HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \ + HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ + HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ + HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \ + HTTPD_VAR_RUN=/var/run/httpd \ + HTTPD_DATA_PATH=/var/www \ + HTTPD_DATA_ORIG_PATH=/var/www \ + HTTPD_VAR_PATH=/var + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY ./s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY ./root/ / + +# Reset permissions of filesystem to default values +RUN /usr/libexec/container-setup && rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image +CMD $STI_SCRIPTS_PATH/usage diff --git a/8.4/Dockerfile.rhel10 b/8.4/Dockerfile.rhel10 new file mode 100644 index 000000000..75f831ea3 --- /dev/null +++ b/8.4/Dockerfile.rhel10 @@ -0,0 +1,91 @@ +FROM ubi10/s2i-base + +# This image provides an Apache+PHP environment for running PHP +# applications. + +EXPOSE 8080 +EXPOSE 8443 + +# Description +# This image provides an Apache 2.4 + PHP 8.4 environment for running PHP applications. +# Exposed ports: +# * 8080 - alternative port for http + +ENV PHP_VERSION=8.4 \ + PHP_VER_SHORT=84 \ + NAME=php + +ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \ + DESCRIPTION="PHP $PHP_VERSION available as container is a base platform for \ +building and running various PHP $PHP_VERSION applications and frameworks. \ +PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers \ +to write dynamically generated web pages. PHP also offers built-in database integration \ +for several commercial and non-commercial database management systems, so writing \ +a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \ +is probably as a replacement for CGI scripts." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Apache 2.4 with PHP ${PHP_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},${NAME}-${PHP_VER_SHORT}" \ + io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ + io.s2i.scripts-url="image:///usr/libexec/s2i" \ + name="ubi10/${NAME}-${PHP_VER_SHORT}" \ + com.redhat.component="${NAME}-${PHP_VER_SHORT}-container" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ + usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app ubi10/${NAME}-${PHP_VER_SHORT} sample-server" \ + maintainer="SoftwareCollections.org " + +# Install Apache httpd and PHP +ARG INSTALL_PKGS="php${PHP_VERSION} php${PHP_VERSION}-fpm mod_ssl hostname" +ARG INSTALL_EXTS="php${PHP_VERSION}-mysqlnd php${PHP_VERSION}-pgsql php${PHP_VERSION}-bcmath \ + php${PHP_VERSION}-gd php${PHP_VERSION}-intl php${PHP_VERSION}-ldap php${PHP_VERSION}-mbstring php${PHP_VERSION}-pdo \ + php${PHP_VERSION}-process php${PHP_VERSION}-soap php${PHP_VERSION}-xml \ + php${PHP_VERSION}-gmp" +ARG INSTALL_EXTS_PECL="php${PHP_VERSION}-pecl-apcu php${PHP_VERSION}-pecl-zip php${PHP_VERSION}-pecl-redis6" + +RUN dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS $INSTALL_EXTS $INSTALL_EXTS_PECL && \ + dnf reinstall -y tzdata && \ + rpm -V $INSTALL_PKGS && \ + php -v | grep -qe "v$PHP_VERSION\." && \ + echo "Found VERSION $PHP_VERSION" && \ + for ext in $(echo $INSTALL_EXTS | sed s/php${PHP_VERSION}-//g) ; do php -m | grep -qi "$ext"; done && \ + for ext in $(echo $INSTALL_EXTS_PECL | sed s/php${PHP_VERSION}-pecl-//g | sed s/redis6/redis/g) ; do php -m | grep -qi "$ext"; done && \ + echo "Found requested extensions" && \ + dnf -y clean all --enablerepo='*' + +ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \ + APP_DATA=${APP_ROOT}/src \ + PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \ + PHP_SYSCONF_PATH=/etc \ + PHP_HTTPD_CONF_FILE=php.conf \ + PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \ + PHP_FPM_CONF_FILE=www.conf \ + PHP_FPM_RUN_DIR=/run/php-fpm \ + PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \ + PHP_FPM_LOG_PATH=/var/log/php-fpm \ + HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \ + HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ + HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ + HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \ + HTTPD_VAR_RUN=/var/run/httpd \ + HTTPD_DATA_PATH=/var/www \ + HTTPD_DATA_ORIG_PATH=/var/www \ + HTTPD_VAR_PATH=/var + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY ./s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY ./root/ / + +# Reset permissions of filesystem to default values +RUN /usr/libexec/container-setup && rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image +CMD $STI_SCRIPTS_PATH/usage diff --git a/8.4/Dockerfile.rhel9 b/8.4/Dockerfile.rhel9 new file mode 100644 index 000000000..a6607cbbe --- /dev/null +++ b/8.4/Dockerfile.rhel9 @@ -0,0 +1,96 @@ +FROM ubi9/s2i-base:1 + +# This image provides an Apache+PHP environment for running PHP +# applications. + +EXPOSE 8080 +EXPOSE 8443 + +# Description +# This image provides an Apache 2.4 + PHP 8.4 environment for running PHP applications. +# Exposed ports: +# * 8080 - alternative port for http + +ENV PHP_VERSION=8.4 \ + PHP_VER_SHORT=84 \ + NAME=php + +ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \ + DESCRIPTION="PHP $PHP_VERSION available as container is a base platform for \ +building and running various PHP $PHP_VERSION applications and frameworks. \ +PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers \ +to write dynamically generated web pages. PHP also offers built-in database integration \ +for several commercial and non-commercial database management systems, so writing \ +a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \ +is probably as a replacement for CGI scripts." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Apache 2.4 with PHP ${PHP_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},${NAME}-${PHP_VER_SHORT}" \ + io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \ + io.s2i.scripts-url="image:///usr/libexec/s2i" \ + name="ubi9/${NAME}-${PHP_VER_SHORT}" \ + com.redhat.component="${NAME}-${PHP_VER_SHORT}-container" \ + version="1" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \ + usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app ubi9/${NAME}-${PHP_VER_SHORT} sample-server" \ + maintainer="SoftwareCollections.org " + +# Install Apache httpd and PHP +ARG INSTALL_PKGS="php php-fpm mod_ssl hostname" +ARG INSTALL_EXTS="php-json php-mysqli php-pgsql php-bcmath \ + php-gd php-intl php-ldap php-mbstring php-pdo \ + php-process php-soap php-opcache php-xml \ + php-gmp php-apcu php-zip php-redis" + +RUN dnf module -y enable php:$PHP_VERSION && \ + dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS $INSTALL_EXTS && \ + dnf reinstall -y tzdata && \ + rpm -V $INSTALL_PKGS && \ + php -v | grep -qe "v$PHP_VERSION\." && \ + echo "Found VERSION $PHP_VERSION" && \ + for ext in $(echo $INSTALL_EXTS | sed s/php-//g) ; do php -m | grep -qi "$ext\$"; done && \ + echo "Found requested extensions" && \ + dnf -y clean all --enablerepo='*' + +ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \ + APP_DATA=${APP_ROOT}/src \ + PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \ + PHP_SYSCONF_PATH=/etc \ + PHP_HTTPD_CONF_FILE=php.conf \ + PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \ + PHP_FPM_CONF_FILE=www.conf \ + PHP_FPM_RUN_DIR=/run/php-fpm \ + PHP_CLEAR_ENV=ON \ + PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \ + PHP_FPM_LOG_PATH=/var/log/php-fpm \ + HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \ + HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ + HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ + HTTPD_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \ + HTTPD_VAR_RUN=/var/run/httpd \ + HTTPD_DATA_PATH=/var/www \ + HTTPD_DATA_ORIG_PATH=/var/www \ + HTTPD_VAR_PATH=/var + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY ./s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY ./root/ / + +# Reset permissions of filesystem to default values +RUN /usr/libexec/container-setup && rpm-file-permissions + +# RPM uses a wrong file in the config +# Related: https://bugzilla.redhat.com/show_bug.cgi?id=2092356 +RUN sed -i "s/mod_php7.c/mod_php.c/" /etc/httpd/conf.d/php.conf + +USER 1001 + +# Set the default CMD to print the usage of the language image +CMD $STI_SCRIPTS_PATH/usage diff --git a/8.4/README.md b/8.4/README.md new file mode 100644 index 000000000..a44b7f690 --- /dev/null +++ b/8.4/README.md @@ -0,0 +1,334 @@ +PHP 8.4 container image +======================= + +This container image includes PHP 8.4 as a [S2I](https://github.com/openshift/source-to-image) base image for your PHP 8.4 applications. +Users can choose between RHEL and CentOS Stream based builder images. +The RHEL UBI images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available on [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments + +Description +----------- + +PHP 8.4 available as container is a base platform for +building and running various PHP 8.4 applications and frameworks. +PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers +to write dynamically generated web pages. PHP also offers built-in database integration +for several commercial and non-commercial database management systems, so writing +a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding +is probably as a replacement for CGI scripts. + +This container image includes an npm utility, so users can use it to install JavaScript +modules for their web applications. There is no guarantee for any specific npm or nodejs +version, that is included in the image; those versions can be changed anytime and +the nodejs itself is included just to make the npm work. + +Usage in OpenShift +------------------ +In this example, we will assume that you are using the `ubi8/php-84` image, available via `php:8.4` imagestream tag in Openshift. + +To build a simple [cakephp-sample-app](https://github.com/sclorg/cakephp-ex.git) application in Openshift: + +``` +oc new-app php:8.4~https://github.com/sclorg/cakephp-ex.git +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + +**Accessing the application:** +``` +$ curl 127.0.0.1:8080 +``` + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this PHP container image, and produce +a new image that runs the assembled application as an output. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application and places them into appropriate directories inside the image. It utilizes some common patterns in PHP application development (see the **Environment variables** section below). +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). It runs `httpd` with PHP support enabled. + +Building an application using a Dockerfile +------------------------------------------ +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build a PHP container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the PHP image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +``` +podman pull ubi8/php-84 +``` + +An UBI image `ubi8/php-84` is used in this example. This image is usable and freely redistributable under the terms of the UBI End User License Agreement (EULA). See more about UBI at [UBI FAQ](https://developers.redhat.com/articles/ubi-faq). + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/cakephp-ex.git is used here. Feel free to clone the repository for further experiments. + +``` +git clone https://github.com/sclorg/cakephp-ex.git app-src +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* installing the dependencies +* setting the default command in the resulting image + +For all these three parts, users can either setup all manually and use commands `./composer.phar` or other commands explicitly in the Dockerfile ([3.1.](#31-to-use-your-own-setup-create-a-dockerfile-with-this-content)), or users can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common PHP applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: +``` +FROM ubi8/php-84 + +# Add application sources +ADD app-src . + +# Install the dependencies +RUN TEMPFILE=$(mktemp) && \ + curl -o "$TEMPFILE" "https://getcomposer.org/installer" && \ + php <"$TEMPFILE" && \ + ./composer.phar install --no-interaction --no-ansi --optimize-autoloader + +# Run script uses standard ways to configure the PHP application +# and execs httpd -D FOREGROUND at the end +# See more in /s2i/bin/run in this repository. +# Shortly what the run script does: The httpd daemon and php needs to be +# configured, so this script prepares the configuration based on the container +# parameters (e.g. available memory) and puts the configuration files into +# the approriate places. +# This can obviously be done differently, and in that case, the final CMD +# should be set to "CMD httpd -D FOREGROUND" instead. +CMD /usr/libexec/s2i/run + +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: +``` +FROM ubi8/php-84 + +# Add application sources to a directory that the assemble script expects them +# and set permissions so that the container runs without root access +USER 0 +ADD app-src /tmp/src +RUN chown -R 1001:0 /tmp/src +USER 1001 + +# Install the dependencies +RUN /usr/libexec/s2i/assemble + +# Set the default command for the resulting image +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step + +``` +podman build -t cakephp-app . +``` + +#### 5. Run the resulting image with the final application + +``` +podman run -d cakephp-app +``` + +Environment variables for Source-to-Image +----------------------------------------- + +To set these environment variables, you can place them as a key value pair into a `.s2i/environment` +file inside your source code repository. + +The following environment variables set their equivalent property value in the php.ini file: +* **ERROR_REPORTING** + * Informs PHP of which errors, warnings and notices you would like it to take action for + * Default: E_ALL & ~E_NOTICE +* **DISPLAY_ERRORS** + * Controls whether or not and where PHP will output errors, notices and warnings + * Default: ON +* **DISPLAY_STARTUP_ERRORS** + * Cause display errors which occur during PHP's startup sequence to be handled separately from display errors + * Default: OFF +* **TRACK_ERRORS** + * Store the last error/warning message in $php_errormsg (boolean) + * Default: OFF +* **HTML_ERRORS** + * Link errors to documentation related to the error + * Default: ON +* **INCLUDE_PATH** + * Path for PHP source files + * Default: .:/opt/app-root/src:/opt/rh/rh-php84/root/usr/share/pear (EL7) + * Default: .:/opt/app-root/src:/usr/share/pear (EL8, Fedora) +* **PHP_MEMORY_LIMIT** + * Memory Limit + * Default: 128M +* **PHP_CLEAR_ENV** + * Sets to clear environment in FPM workers. See [FPM_CONFIGURATION](https://www.php.net/manual/en/install.fpm.configuration.php). + * Default: ON +* **SESSION_NAME** + * Name of the session + * Default: PHPSESSID +* **SESSION_HANDLER** + * Method for saving sessions + * Default: files +* **SESSION_PATH** + * Location for session data files + * Default: /tmp/sessions +* **SESSION_COOKIE_DOMAIN** + * The domain for which the cookie is valid. + * Default: +* **SESSION_COOKIE_HTTPONLY** + * Whether or not to add the httpOnly flag to the cookie + * Default: 0 +* **SESSION_COOKIE_SECURE** + * Specifies whether cookies should only be sent over secure connections. + * Default: Off +* **SHORT_OPEN_TAG** + * Determines whether or not PHP will recognize code between tags + * Default: OFF +* **DOCUMENTROOT** + * Path that defines the DocumentRoot for your application (ie. /public) + * Default: / + +The following environment variables set their equivalent property value in the opcache.ini file: +* **OPCACHE_MEMORY_CONSUMPTION** + * The OPcache shared memory storage size in megabytes + * Default: 128 +* **OPCACHE_REVALIDATE_FREQ** + * How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request. + * Default: 2 +* **OPCACHE_MAX_FILES** + * The maximum number of keys (scripts) in the OPcache hash table. Only numbers between 200 and 1000000 are allowed. + * Default: 4000 + +You can also override the entire directory used to load the PHP configuration by setting: +* **PHPRC** + * Sets the path to the php.ini file +* **PHP_INI_SCAN_DIR** + * Path to scan for additional ini configuration files + +You can override the Apache [MPM prefork](https://httpd.apache.org/docs/2.4/mod/mpm_common.html) +settings to increase the performance for of the PHP application. In case you set +some Cgroup limits, the image will attempt to automatically set the +optimal values. You can override this at any time by specifying the values +yourself: + +* **HTTPD_START_SERVERS** + * The [StartServers](https://httpd.apache.org/docs/2.4/mod/mpm_common.html#startservers) + directive sets the number of child server processes created on startup. + * Default: 8 +* **HTTPD_MAX_REQUEST_WORKERS** + * The [MaxRequestWorkers](https://httpd.apache.org/docs/2.4/mod/mpm_common.html#maxrequestworkers) + directive sets the limit on the number of simultaneous requests that will be served. + * `MaxRequestWorkers` was called `MaxClients` before version httpd 2.3.13. + * Default: 256 (this is automatically tuned by setting Cgroup limits for the container using this formula: + `TOTAL_MEMORY / 15MB`. The 15MB is average size of a single httpd process. +* **HTTPD_MAX_REQUESTS_PER_CHILD** + * The [MaxRequestsPerChild](http://httpd.apache.org/docs/current/mod/mpm_common.html#maxconnectionsperchild) + directive sets the limit on the number of connections that an individual child server process will handle. + After `MaxRequestsPerChild` connections, the child process will die. If `MaxRequestsPerChild` is 0, then the process will never expire. + * Setting `MaxRequestsPerChild` to a non-zero value limits the amount of memory that a process can consume by (accidental) memory leakage. + * `MaxRequestsPerChild` is called `MaxConnectionsPerChild` in Apache HTTP 2.3.9 and later. + * Default: 4000 +* **HTTPD_MAX_KEEPALIVE_REQUESTS** + * The [MaxKeepAliveRequests](http://httpd.apache.org/docs/current/mod/core.html#maxkeepaliverequests) + directive limits the number of requests allowed per connection when `KeepAlive` is on. If it is set to 0, unlimited requests will be allowed. + * Default: 100 + + You can use a custom composer repository mirror URL to download packages instead of the default 'packagist.org': + + * **COMPOSER_MIRROR** + * Adds a custom composer repository mirror URL to composer configuration. Note: This only affects packages listed in composer.json. + * **COMPOSER_INSTALLER** + * Overrides the default URL for downloading Composer of https://getcomposer.org/installer. Useful in disconnected environments. + * **COMPOSER_VERSION** + * Overrides the default composer version to install (1, 2, preview, snapshot or version="x.y.z") + * **COMPOSER_ARGS** + * Adds extra arguments to the `composer install` command line (for example `--no-dev`). + + +Source repository layout +------------------------ + +You do not need to change anything in your existing PHP project's repository. +However, if these files exist they will affect the behavior of the build process: + +* **composer.json** + + List of dependencies to be installed with `composer`. The format is documented + [here](https://getcomposer.org/doc/04-schema.md). + + +* **.htaccess** + + In case the **DocumentRoot** of the application is nested within the source directory `/opt/app-root/src`, + users can provide their own Apache **.htaccess** file. This allows the overriding of Apache's behavior and + specifies how application requests should be handled. The **.htaccess** file needs to be located at the root + of the application source. + +Hot deploy +---------- + +In order to immediately pick up changes made in your application source code, you need to run your built image with the `OPCACHE_REVALIDATE_FREQ=0` environment variable passed to [Podman](https://github.com/containers/libpod) `-e` run flag: + +``` +$ podman run -e OPCACHE_REVALIDATE_FREQ=0 -p 8080:8080 php-app +``` + +To change your source code in running container, use Podman's [exec](https://github.com/containers/libpod)) command: +``` +podman exec -it /bin/bash +``` + +After you [Podman exec](https://github.com/containers/libpod) into the running container, your current directory is set +to `/opt/app-root/src`, where the source code is located. + + +Extending image +--------------- +Not only content, but also startup scripts and configuration of the image can +be extended using [source-to-image](https://github.com/openshift/source-to-image). + +The structure of the application can look like this: + +| Folder name | Description | +|-------------------|----------------------------| +| `./httpd-cfg` | Can contain additional Apache configuration files (`*.conf`)| +| `./httpd-ssl` | Can contain own SSL certificate (in `certs/` subdirectory) and key (in `private/` subdirectory)| +| `./php-pre-start`| Can contain shell scripts (`*.sh`) that are sourced before `httpd` is started| +| `./php-post-assemble`| Can contain shell scripts (`*.sh`) that are sourced at the end of `assemble` script| +| `./` | Application source code | + + +See also +-------- +Dockerfile and other sources are available on https://github.com/sclorg/s2i-php-container. +In that repository you also can find another versions of Python environment Dockerfiles. +Dockerfile for RHEL8 is called `Dockerfile.rhel8`, Dockerfile for RHEL9 is called `Dockerfile.rhel9`, +Dockerfile for RHEL9 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`,and the Fedora Dockerfile is called Dockerfile.fedora. + +Security Implications +--------------------- + +-p 8080:8080 + + Opens container port 8080 and maps it to the same port on the Host. diff --git a/8.4/root/opt/app-root/etc/php.d/10-opcache.ini.template b/8.4/root/opt/app-root/etc/php.d/10-opcache.ini.template new file mode 100644 index 000000000..40e97f645 --- /dev/null +++ b/8.4/root/opt/app-root/etc/php.d/10-opcache.ini.template @@ -0,0 +1,111 @@ +; Determines if Zend OPCache is enabled +opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=0 + +; The OPcache shared memory storage size. +opcache.memory_consumption=${OPCACHE_MEMORY_CONSUMPTION} + +; 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=${OPCACHE_MAX_FILES} + +; 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=${OPCACHE_REVALIDATE_FREQ} + +; 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. +opcache.blacklist_filename=${PHP_SYSCONF_PATH}/php.d/opcache*.blacklist + +; Allows exclusion of large files from being cached. By default all files +; are cached. +opcache.max_file_size=1M + +; 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= + +; 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. +; RPM note : file cache directory must be owned by process owner +; for mod_php, see /etc/httpd/conf.d/php.conf +; for php-fpm, see /etc/php-fpm.d/*conf +;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 + + +; 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=0 + diff --git a/8.4/root/opt/app-root/etc/php.ini.template b/8.4/root/opt/app-root/etc/php.ini.template new file mode 100644 index 000000000..7aff9a75a --- /dev/null +++ b/8.4/root/opt/app-root/etc/php.ini.template @@ -0,0 +1,1607 @@ +[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.hash_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 + +; url_rewriter.tags +; Default Value: "a=href,area=href,frame=src,form=,fieldset=" +; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" + +; 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 = Off + +;;;;;;;;;;;;;;;;;;; +; 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 = 300 + +; 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 + +; How many multipart body parts (combined input variable and file uploads) may +; be accepted. +; Default Value: -1 (Sum of max_input_vars and max_file_uploads) +;max_multipart_body_parts = 1500 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = ${PHP_MEMORY_LIMIT} + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 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 = ${ERROR_REPORTING} + +; 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 = ${DISPLAY_ERRORS} + +; 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 = ${DISPLAY_STARTUP_ERRORS} + +; 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. +; This directive is DEPRECATED. +; Default Value: Off +; Development Value: Off +; Production Value: Off +; http://php.net/track-errors +track_errors = ${TRACK_ERRORS} + +; 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 = ${HTML_ERRORS} + +; 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. +;error_log = syslog + +;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 = "EGPCS" + +; 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 = 200M + +; 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 character encoding using +; the Content-type: header. To disable sending of the charset, simply +; set it to be empty. +; +; PHP's built-in default is 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. +; mbstring or iconv output handler 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 +include_path = ${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 + +; 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 + +;;;;;;;;;;;;;;;; +; 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 = /tmp + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 200M + +; 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 +; +; For example: +; +; extension=mysqli +; +; When the extension library to load is not located in the default extension +; directory, You may specify an absolute path to the library file: +; +; extension=/path/to/extension/mysqli.so +; +; Note : The syntax used in previous PHP versions ('extension=.so' and +; 'extension='php_.dll') is supported for legacy reasons and may be +; deprecated in a future PHP major version. So, when it is possible, please +; move to the new ('extension=) syntax. + +;;;; +; Note: packaged extension modules are now loaded via the .ini files +; found in the directory /etc/php.d; these are loaded by default. +;;;; + +;;;;;;;;;;;;;;;;;;; +; 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 = UTC + +; 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 + +[sqlite] +; http://php.net/sqlite.assoc-case +;sqlite.assoc_case = 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 Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +sendmail_path = /usr/sbin/sendmail -t -i + +; 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 + +; Use mixed LF and CRLF line separators to keep compatibility with some +; RFC 2822 non conformant MTA. +mail.mixed_lf_and_crlf = Off + +; 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; +;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 = + +[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 + +; 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 + +[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 = ${SESSION_HANDLER} + +; 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 + +; RPM note : session directory must be owned by process owner +; for mod_php, see /etc/httpd/conf.d/php.conf +; for php-fpm, see /etc/php-fpm.d/*conf +session.save_path = ${SESSION_PATH} + +; 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 = ${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 = ${SESSION_NAME} + +; 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 = ${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 = ${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 = + +; How many bytes to read from the file. +; http://php.net/session.entropy-length +;session.entropy_length = 32 + +; Specified here to create the session id. +; http://php.net/session.entropy-file +; Defaults to /dev/urandom +; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom +; If neither are found at compile time, the default is no entropy file. +; On windows, setting the entropy_length setting will activate the +; Windows random source (using the CryptoAPI) +;session.entropy_file = /dev/urandom + +; 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 + +; Select a hash function for use in generating session ids. +; Possible Values +; 0 (MD5 128 bits) +; 1 (SHA-1 160 bits) +; This option may also be set to the name of any hash function supported by +; the hash extension. A list of available hashes is returned by the hash_algos() +; function. +; http://php.net/session.hash-function +session.hash_function = 0 + +; 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.hash_bits_per_character = 5 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; form/fieldset are special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. If you want XHTML conformity, remove the form entry. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=,fieldset=" +; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; http://php.net/url-rewriter.tags +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" + +; 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" + +[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 + +[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 = 0 + +[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 + +; RPM note : cache directory must be owned by process owner +; for mod_php, see /etc/httpd/conf.d/php.conf +; for php-fpm, see /etc/php-fpm.d/*conf +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= + +[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: diff --git a/8.4/root/usr/libexec/container-setup b/8.4/root/usr/libexec/container-setup new file mode 100755 index 000000000..348c1096e --- /dev/null +++ b/8.4/root/usr/libexec/container-setup @@ -0,0 +1,68 @@ +#!/bin/bash + +set -e + +# In order to drop the root user, we have to make some directories world +# writeable as OpenShift default security model is to run the container under +# random UID. + +source ${PHP_CONTAINER_SCRIPTS_PATH}/common.sh + +# compatibility symlinks so we hide SCL paths +if [ -v SCL_ENABLED ] ; then + # /opt/rh/httpd24/root/etc/httpd will be symlink to /etc/httpd + mv /opt/rh/httpd24/root/etc/httpd /etc/httpd + ln -s /etc/httpd /opt/rh/httpd24/root/etc/httpd + + # /opt/rh/httpd24/root/var/run/httpd will be symlink to /var/run/httpd + mv /opt/rh/httpd24/root/var/run/httpd /var/run/httpd + ln -s /var/run/httpd /opt/rh/httpd24/root/var/run/httpd + + # /opt/rh/httpd24/root/var/www will be symlink to /var/www + rm -rf /var/www + mv ${HTTPD_DATA_ORIG_PATH} /var/www + ln -s /var/www ${HTTPD_DATA_ORIG_PATH} +else + rm -f /opt/app-root/etc/scl_enable +fi + +/usr/libexec/httpd-ssl-gencerts + +mkdir -p ${HTTPD_CONFIGURATION_PATH} +chmod -R a+rwx ${HTTPD_MAIN_CONF_PATH} +chmod -R a+rwx ${HTTPD_MAIN_CONF_D_PATH} +chmod -R ug+r /etc/pki/tls/certs/localhost.crt +chown -R 1001:0 /etc/pki/tls/certs/localhost.crt +chmod -R ug+r /etc/pki/tls/private/localhost.key +chown -R 1001:0 /etc/pki/tls/private/localhost.key +mkdir -p ${APP_ROOT}/etc +chmod -R a+rwx ${APP_ROOT}/etc +chmod -R a+rwx ${HTTPD_VAR_RUN} +chown -R 1001:0 ${APP_ROOT} +mkdir -p /tmp/sessions +chmod -R a+rwx /tmp/sessions +chown -R 1001:0 /tmp/sessions +chown -R 1001:0 ${HTTPD_DATA_PATH} + +chmod a+rwx "${PHP_SYSCONF_PATH}/php.ini" +chmod -R a+rwx "${PHP_SYSCONF_PATH}/php.d" +chmod -R a+rwx "${PHP_SYSCONF_PATH}/php-fpm.d" + +if [ "x$PLATFORM" == "xel10" ] || [ "x$PLATFORM" == "xel9" ] || [ "x$PLATFORM" == "xfedora" ]; then + if [ -v PHP_FPM_RUN_DIR ]; then + mkdir -p ${PHP_FPM_RUN_DIR} + chmod -R a+rwx ${PHP_FPM_RUN_DIR} + chown -R 1001:0 ${PHP_FPM_RUN_DIR} + mkdir -p ${PHP_FPM_LOG_PATH} + chmod -R a+rwx ${PHP_FPM_LOG_PATH} + chown -R 1001:0 ${PHP_FPM_LOG_PATH} + fi + if [ "${PHP_CLEAR_ENV:-ON}" == "OFF" ]; then + echo "Setting clear_env to no in assemble script" + sed -e 's/^[;]*\s*clear_env\s*=.*$/clear_env = no/' -i ${PHP_FPM_CONF_D_PATH}/${PHP_FPM_CONF_FILE} + fi +fi + +mkdir -p ${PHP_CONTAINER_SCRIPTS_PATH}/pre-init + +config_general diff --git a/8.4/root/usr/share/container-scripts/php/common.sh b/8.4/root/usr/share/container-scripts/php/common.sh new file mode 100644 index 000000000..5a3744faf --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/common.sh @@ -0,0 +1,169 @@ +if [ "x$PLATFORM" == "xel7" ]; then + HTTPCONF_LINENO=151 +elif head "/etc/redhat-release" | grep -q "^Fedora"; then + HTTPCONF_LINENO=156 +elif [ "x$PLATFORM" == "xel9" ] || [ "x$PLATFORM" == "xel10" ] ; then + HTTPCONF_LINENO=156 +else + HTTPCONF_LINENO=154 +fi + +config_httpd_conf() { + sed -i "s/^Listen 80/Listen 0.0.0.0:8080/" ${HTTPD_MAIN_CONF_PATH}/httpd.conf + sed -i "s/^User apache/User default/" ${HTTPD_MAIN_CONF_PATH}/httpd.conf + sed -i "s/^Group apache/Group root/" ${HTTPD_MAIN_CONF_PATH}/httpd.conf + sed -i "s%^DocumentRoot \"${HTTPD_DATA_ORIG_PATH}/html\"%#DocumentRoot \"${APP_DATA}\"%" ${HTTPD_MAIN_CONF_PATH}/httpd.conf + sed -i "s%^ "${HTTPD_MODULES_CONF_D_PATH}/00-mpm.conf" + else + # overwrite default rhel-8 mpm mode + echo "LoadModule mpm_prefork_module modules/mod_mpm_prefork.so" > "${HTTPD_MODULES_CONF_D_PATH}/00-mpm.conf" + fi +} + +config_general() { + config_httpd_conf + config_ssl_conf + config_modules_conf + if [ -d "/run/php-fpm" ]; then + sed -i -E "/php_value\[session.save_path\]/d" ${PHP_FPM_CONF_D_PATH}/${PHP_FPM_CONF_FILE} + sed -e '/catch_workers_output/d' -e '/error_log/d' -i ${PHP_FPM_CONF_D_PATH}/${PHP_FPM_CONF_FILE} + if [ "${PHP_CLEAR_ENV:-ON}" == "OFF" ]; then + echo "Setting clear_env to no in assemble script" + sed -e 's/^[;]*\s*clear_env\s*=.*$/clear_env = no/' -i ${PHP_FPM_CONF_D_PATH}/${PHP_FPM_CONF_FILE} + fi + else + sed -i '/php_value session.save_/d' ${HTTPD_MAIN_CONF_D_PATH}/${PHP_HTTPD_CONF_FILE} + fi + head -n${HTTPCONF_LINENO} ${HTTPD_MAIN_CONF_PATH}/httpd.conf | tail -n1 | grep "AllowOverride All" || exit 1 + echo "IncludeOptional ${APP_ROOT}/etc/conf.d/*.conf" >> ${HTTPD_MAIN_CONF_PATH}/httpd.conf +} + +function log_info { + echo "---> `date +%T` $@" +} + +function log_and_run { + log_info "Running $@" + "$@" +} + +function log_volume_info { + CONTAINER_DEBUG=${CONTAINER_DEBUG:-} + if [[ "${CONTAINER_DEBUG,,}" != "true" ]]; then + return + fi + + log_info "Volume info for $@:" + set +e + log_and_run mount + while [ $# -gt 0 ]; do + log_and_run ls -alZ $1 + shift + done + set -e +} + +# get_matched_files finds file for image extending +function get_matched_files() { + local custom_dir default_dir + custom_dir="$1" + default_dir="$2" + files_matched="$3" + find "$default_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" + [ -d "$custom_dir" ] && find "$custom_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" +} + +# process_extending_files process extending files in $1 and $2 directories +# - source all *.sh files +# (if there are files with same name source only file from $1) +function process_extending_files() { + local custom_dir default_dir + custom_dir=$1 + default_dir=$2 + + while read filename ; do + echo "=> sourcing $filename ..." + # Custom file is prefered + if [ -f $custom_dir/$filename ]; then + source $custom_dir/$filename + elif [ -f $default_dir/$filename ]; then + source $default_dir/$filename + fi + done <<<"$(get_matched_files "$custom_dir" "$default_dir" '*.sh' | sort -u)" +} + +# process extending config files in $1 and $2 directories +# - expand variables in *.conf and copy the files into /opt/app-root/etc/httpd.d directory +# (if there are files with same name source only file from $1) +function process_extending_config_files() { + local custom_dir default_dir + custom_dir=$1 + default_dir=$2 + + while read filename ; do + echo "=> sourcing $filename ..." + # Custom file is prefered + if [ -f $custom_dir/$filename ]; then + envsubst < $custom_dir/$filename > ${HTTPD_CONFIGURATION_PATH}/$filename + elif [ -f $default_dir/$filename ]; then + envsubst < $default_dir/$filename > ${HTTPD_CONFIGURATION_PATH}/$filename + fi + done <<<"$(get_matched_files "$custom_dir" "$default_dir" '*.conf' | sort -u)" +} + +# Copy config files from application to the location where httpd expects them +# Param sets the directory where to look for files +# This function was taken from httpd container +process_config_files() { + local dir=${1:-.} + if [ -d ${dir}/httpd-cfg ]; then + echo "---> Copying httpd configuration files..." + if [ "$(ls -A ${dir}/httpd-cfg/*.conf)" ]; then + cp -v ${dir}/httpd-cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"/ + rm -rf ${dir}/httpd-cfg + fi + fi +} + +# Copy SSL files provided in application source +# This function was taken from httpd container +process_ssl_certs() { + local dir=${1:-.} + if [ -d ${dir}/httpd-ssl/private ] && [ -d ${dir}/httpd-ssl/certs ]; then + echo "---> Looking for SSL certs for httpd..." + cp -r ${dir}/httpd-ssl ${APP_ROOT} + local ssl_cert="$(ls -A ${APP_ROOT}/httpd-ssl/certs/*.pem | head -n 1)" + local ssl_private="$(ls -A ${APP_ROOT}/httpd-ssl/private/*.pem | head -n 1)" + if [ -f "${ssl_cert}" ] ; then + # do sed for SSLCertificateFile and SSLCertificateKeyFile + echo "---> Setting SSL cert file for httpd..." + sed -i -e "s|^SSLCertificateFile .*$|SSLCertificateFile ${ssl_cert}|" ${HTTPD_MAIN_CONF_D_PATH}/ssl.conf + if [ -f "${ssl_private}" ]; then + echo "---> Setting SSL key file for httpd..." + sed -i -e "s|^SSLCertificateKeyFile .*$|SSLCertificateKeyFile ${ssl_private}|" ${HTTPD_MAIN_CONF_D_PATH}/ssl.conf + else + echo "---> Removing SSL key file settings for httpd..." + sed -i '/^SSLCertificateKeyFile .*/d' ${HTTPD_MAIN_CONF_D_PATH}/ssl.conf + fi + fi + rm -rf ${dir}/httpd-ssl + fi +} + diff --git a/8.4/root/usr/share/container-scripts/php/httpd-cnf/00-documentroot.conf b/8.4/root/usr/share/container-scripts/php/httpd-cnf/00-documentroot.conf new file mode 100644 index 000000000..bd3600f09 --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/httpd-cnf/00-documentroot.conf @@ -0,0 +1 @@ +DocumentRoot "/opt/app-root/src${DOCUMENTROOT}" diff --git a/8.4/root/usr/share/container-scripts/php/httpd-cnf/50-mpm-tuning.conf b/8.4/root/usr/share/container-scripts/php/httpd-cnf/50-mpm-tuning.conf new file mode 100644 index 000000000..bfe131c10 --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/httpd-cnf/50-mpm-tuning.conf @@ -0,0 +1,12 @@ + + # This value should mirror what is set in MinSpareServers. + StartServers ${HTTPD_START_SERVERS} + MinSpareServers ${HTTPD_START_SERVERS} + MaxSpareServers ${HTTPD_MAX_SPARE_SERVERS} + # The MaxRequestWorkers directive sets the limit on the number of simultaneous requests that will be served. + # The default value, when no Cgroup limits are set is 256. + MaxRequestWorkers ${HTTPD_MAX_REQUEST_WORKERS} + ServerLimit ${HTTPD_MAX_REQUEST_WORKERS} + MaxRequestsPerChild ${HTTPD_MAX_REQUESTS_PER_CHILD} + MaxKeepAliveRequests ${HTTPD_MAX_KEEPALIVE_REQUESTS} + diff --git a/8.4/root/usr/share/container-scripts/php/post-assemble/20-copy-config.sh b/8.4/root/usr/share/container-scripts/php/post-assemble/20-copy-config.sh new file mode 100644 index 000000000..cd6a356af --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/post-assemble/20-copy-config.sh @@ -0,0 +1,6 @@ +# additional arbitrary httpd configuration provided by user using s2i + +log_info 'Processing additional arbitrary httpd configuration provided by s2i ...' + +process_extending_config_files ${APP_DATA}/httpd-cfg/ ${PHP_CONTAINER_SCRIPTS_PATH}/httpd-cnf/ + diff --git a/8.4/root/usr/share/container-scripts/php/post-assemble/40-ssl-certs.sh b/8.4/root/usr/share/container-scripts/php/post-assemble/40-ssl-certs.sh new file mode 100644 index 000000000..a003826a2 --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/post-assemble/40-ssl-certs.sh @@ -0,0 +1,4 @@ +source ${PHP_CONTAINER_SCRIPTS_PATH}/common.sh + +# Copy SSL files provided in application source +process_ssl_certs diff --git a/8.4/root/usr/share/container-scripts/php/pre-start/20-copy-config.sh b/8.4/root/usr/share/container-scripts/php/pre-start/20-copy-config.sh new file mode 100644 index 000000000..cd6a356af --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/pre-start/20-copy-config.sh @@ -0,0 +1,6 @@ +# additional arbitrary httpd configuration provided by user using s2i + +log_info 'Processing additional arbitrary httpd configuration provided by s2i ...' + +process_extending_config_files ${APP_DATA}/httpd-cfg/ ${PHP_CONTAINER_SCRIPTS_PATH}/httpd-cnf/ + diff --git a/8.4/root/usr/share/container-scripts/php/pre-start/40-ssl-certs.sh b/8.4/root/usr/share/container-scripts/php/pre-start/40-ssl-certs.sh new file mode 100644 index 000000000..541bbce40 --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/pre-start/40-ssl-certs.sh @@ -0,0 +1,4 @@ +source ${PHP_CONTAINER_SCRIPTS_PATH}/common.sh + +# Copy SSL files provided in application source +process_ssl_certs ${APP_ROOT}/src diff --git a/8.4/root/usr/share/container-scripts/php/pre-start/60-fpm.sh b/8.4/root/usr/share/container-scripts/php/pre-start/60-fpm.sh new file mode 100644 index 000000000..f263fd5fc --- /dev/null +++ b/8.4/root/usr/share/container-scripts/php/pre-start/60-fpm.sh @@ -0,0 +1,6 @@ +if [ -d "/run/php-fpm" ]; then + log_info "Starting FPM - pre-start" + /usr/sbin/php-fpm --daemonize +else + log_info "Using mod_php" +fi diff --git a/8.4/s2i/bin/assemble b/8.4/s2i/bin/assemble new file mode 100755 index 000000000..663f7c5f1 --- /dev/null +++ b/8.4/s2i/bin/assemble @@ -0,0 +1,78 @@ +#!/bin/bash + +set -e + +source ${PHP_CONTAINER_SCRIPTS_PATH}/common.sh + +shopt -s dotglob +echo "---> Installing application source..." +rm -fR /tmp/src/.git +mv /tmp/src/* ./ + +# Fix source directory permissions +fix-permissions ./ +fix-permissions ${HTTPD_CONFIGURATION_PATH} + +# Change the npm registry mirror if provided +if [ -n "$NPM_MIRROR" ]; then + npm config set registry $NPM_MIRROR +fi + +if [ -f composer.json ]; then + echo "Found 'composer.json', installing dependencies using composer.phar... " + + # Install Composer + TEMPFILE=$(mktemp) + RETRIES=6 + for ((i=0; i<$RETRIES; i++)); do + + if [ -z "$COMPOSER_INSTALLER" ]; then + export COMPOSER_INSTALLER="https://getcomposer.org/installer" + fi + + echo "Downloading $COMPOSER_INSTALLER, attempt $((i+1))/$RETRIES" + curl -o $TEMPFILE $COMPOSER_INSTALLER && break + sleep 10 + done + if [[ $i == $RETRIES ]]; then + echo "Download failed, giving up." + exit 1 + fi + + if [ -z $COMPOSER_VERSION ]; then + echo "By default, latest composer will be used. If you want to use v1 please use the environment variable COMPOSER_VERSION=1" + php <$TEMPFILE + else + echo "You set the COMPOSER_VERSION" + php <$TEMPFILE -- --$COMPOSER_VERSION + fi + + if [ "$(ls -a /tmp/artifacts/ 2>/dev/null)" ]; then + echo "Restoring build artifacts" + mv /tmp/artifacts/* $HOME/ + fi + + # Change the repo mirror if provided + if [ -n "$COMPOSER_MIRROR" ]; then + ./composer.phar config -g repositories.packagist composer $COMPOSER_MIRROR + fi + + # Install App dependencies using Composer + ./composer.phar install --no-interaction --no-ansi --optimize-autoloader $COMPOSER_ARGS + + if [ ! -f composer.lock ]; then + echo -e "\nConsider adding a 'composer.lock' file into your source repository.\n" + fi +fi + +if [ "${PHP_CLEAR_ENV:-ON}" == "OFF" ]; then + echo "Setting clear_env to no in assemble script" + sed -e 's/^[;]*\s*clear_env\s*=.*$/clear_env = no/' -i ${PHP_FPM_CONF_D_PATH}/${PHP_FPM_CONF_FILE} +fi + +# post-assemble files +process_extending_files ./php-post-assemble/ ${PHP_CONTAINER_SCRIPTS_PATH}/post-assemble/ + +# Fix source directory permissions +fix-permissions ./ +fix-permissions ${HTTPD_CONFIGURATION_PATH} diff --git a/8.4/s2i/bin/run b/8.4/s2i/bin/run new file mode 100755 index 000000000..c2fd6de9d --- /dev/null +++ b/8.4/s2i/bin/run @@ -0,0 +1,78 @@ +#!/bin/bash + +source ${PHP_CONTAINER_SCRIPTS_PATH}/common.sh + +export_vars=$(cgroup-limits); export $export_vars +export DOCUMENTROOT=${DOCUMENTROOT:-/} + +# Default php.ini configuration values, all taken +# from php defaults. +export ERROR_REPORTING=${ERROR_REPORTING:-E_ALL & ~E_NOTICE} +export DISPLAY_ERRORS=${DISPLAY_ERRORS:-ON} +export DISPLAY_STARTUP_ERRORS=${DISPLAY_STARTUP_ERRORS:-OFF} +export TRACK_ERRORS=${TRACK_ERRORS:-OFF} +export HTML_ERRORS=${HTML_ERRORS:-ON} +export INCLUDE_PATH=${INCLUDE_PATH:-.:/opt/app-root/src:${PHP_DEFAULT_INCLUDE_PATH}} +export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT:-128M} +export SESSION_NAME=${SESSION_NAME:-PHPSESSID} +export SESSION_HANDLER=${SESSION_HANDLER:-files} +export SESSION_PATH=${SESSION_PATH:-/tmp/sessions} +export SESSION_COOKIE_DOMAIN=${SESSION_COOKIE_DOMAIN:-} +export SESSION_COOKIE_HTTPONLY=${SESSION_COOKIE_HTTPONLY:-} +export SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-0} +export SHORT_OPEN_TAG=${SHORT_OPEN_TAG:-OFF} + +# TODO should be dynamically calculated based on container memory limit/16 +export OPCACHE_MEMORY_CONSUMPTION=${OPCACHE_MEMORY_CONSUMPTION:-128} + +export OPCACHE_REVALIDATE_FREQ=${OPCACHE_REVALIDATE_FREQ:-2} +export OPCACHE_MAX_FILES=${OPCACHE_MAX_FILES:-4000} + +export PHPRC=${PHPRC:-${PHP_SYSCONF_PATH}/php.ini} +export PHP_INI_SCAN_DIR=${PHP_INI_SCAN_DIR:-${PHP_SYSCONF_PATH}/php.d} + +envsubst < /opt/app-root/etc/php.ini.template > ${PHP_SYSCONF_PATH}/php.ini +envsubst < /opt/app-root/etc/php.d/10-opcache.ini.template > ${PHP_SYSCONF_PATH}/php.d/10-opcache.ini + +export HTTPD_START_SERVERS=${HTTPD_START_SERVERS:-8} +export HTTPD_MAX_SPARE_SERVERS=$((HTTPD_START_SERVERS+10)) +export HTTPD_MAX_REQUESTS_PER_CHILD=${HTTPD_MAX_REQUESTS_PER_CHILD:-4000} +export HTTPD_MAX_KEEPALIVE_REQUESTS=${HTTPD_MAX_KEEPALIVE_REQUESTS:-100} + +if [ -n "${NO_MEMORY_LIMIT:-}" -o -z "${MEMORY_LIMIT_IN_BYTES:-}" ]; then + # + export HTTPD_MAX_REQUEST_WORKERS=${HTTPD_MAX_REQUEST_WORKERS:-256} +else + # A simple calculation for MaxRequestWorkers would be: Total Memory / Size Per Apache process. + # The total memory is determined from the Cgroups and the average size for the + # Apache process is estimated to 15MB. + max_clients_computed=$((MEMORY_LIMIT_IN_BYTES/1024/1024/15)) + # The MaxClients should never be lower than StartServers, which is set to 5. + # In case the container has memory limit set to <64M we pin the MaxClients to 4. + [[ $max_clients_computed -le 4 ]] && max_clients_computed=4 + export HTTPD_MAX_REQUEST_WORKERS=${HTTPD_MAX_REQUEST_WORKERS:-$max_clients_computed} + echo "-> Cgroups memory limit is set, using HTTPD_MAX_REQUEST_WORKERS=${HTTPD_MAX_REQUEST_WORKERS}" +fi + + + +if [ "x$PLATFORM" == "xel10" ] || [ "x$PLATFORM" == "xel9" ] || [ "x$PLATFORM" == "xfedora" ]; then + if [ -n "${PHP_FPM_RUN_DIR:-}" ]; then + /bin/ln -s /dev/stderr ${PHP_FPM_LOG_PATH}/error.log + mkdir -p ${PHP_FPM_RUN_DIR} + chmod -R a+rwx ${PHP_FPM_RUN_DIR} + chown -R 1001:0 ${PHP_FPM_RUN_DIR} + mkdir -p ${PHP_FPM_LOG_PATH} + chmod -R a+rwx ${PHP_FPM_LOG_PATH} + chown -R 1001:0 ${PHP_FPM_LOG_PATH} + fi + if [ "${PHP_CLEAR_ENV:-ON}" == "OFF" ]; then + echo "Setting clear_env to no in assemble script" + sed -e 's/^[;]*\s*clear_env\s*=.*$/clear_env = no/' -i ${PHP_FPM_CONF_D_PATH}/${PHP_FPM_CONF_FILE} + fi +fi + +# pre-start files +process_extending_files ${APP_DATA}/php-pre-start/ ${PHP_CONTAINER_SCRIPTS_PATH}/pre-start/ + +exec httpd -D FOREGROUND diff --git a/8.4/s2i/bin/save-artifacts b/8.4/s2i/bin/save-artifacts new file mode 100755 index 000000000..7e4773a95 --- /dev/null +++ b/8.4/s2i/bin/save-artifacts @@ -0,0 +1,4 @@ +#!/bin/sh +pushd ${HOME} >/dev/null +tar cf - vendor +popd >/dev/null diff --git a/8.4/s2i/bin/usage b/8.4/s2i/bin/usage new file mode 100755 index 000000000..f43328700 --- /dev/null +++ b/8.4/s2i/bin/usage @@ -0,0 +1,26 @@ +#!/bin/sh + +DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` +NAMESPACE=sclorg +if [[ $DISTRO =~ rhel* ]]; then + NAMESPACE=rhel10 + DISTRO="" +else + DISTRO="-c10s" +fi + +cat < -- curl 127.0.0.1:8080 + +Alternatively, to run the image directly using podman or docker, or how to use it as a parent image in a Dockerfile, see documentation at +https://github.com/sclorg/s2i-php-container/blob/master/${PHP_VERSION}/README.md +EOF diff --git a/8.4/test/__init__.py b/8.4/test/__init__.py new file mode 120000 index 000000000..d0f4746a3 --- /dev/null +++ b/8.4/test/__init__.py @@ -0,0 +1 @@ +../../test/__init__.py \ No newline at end of file diff --git a/8.4/test/conftest.py b/8.4/test/conftest.py new file mode 120000 index 000000000..3f2d78400 --- /dev/null +++ b/8.4/test/conftest.py @@ -0,0 +1 @@ +../../test/conftest.py \ No newline at end of file diff --git a/8.4/test/examples b/8.4/test/examples new file mode 120000 index 000000000..da7b19653 --- /dev/null +++ b/8.4/test/examples @@ -0,0 +1 @@ +../../examples/ \ No newline at end of file diff --git a/8.4/test/imagestreams b/8.4/test/imagestreams new file mode 120000 index 000000000..0dcbe9e02 --- /dev/null +++ b/8.4/test/imagestreams @@ -0,0 +1 @@ +../../imagestreams/ \ No newline at end of file diff --git a/8.4/test/run b/8.4/test/run new file mode 120000 index 000000000..44977d634 --- /dev/null +++ b/8.4/test/run @@ -0,0 +1 @@ +../../test/run \ No newline at end of file diff --git a/8.4/test/run-openshift-pytest b/8.4/test/run-openshift-pytest new file mode 120000 index 000000000..5063ae304 --- /dev/null +++ b/8.4/test/run-openshift-pytest @@ -0,0 +1 @@ +../../test/run-openshift-pytest \ No newline at end of file diff --git a/8.4/test/run-pytest b/8.4/test/run-pytest new file mode 120000 index 000000000..efe32b484 --- /dev/null +++ b/8.4/test/run-pytest @@ -0,0 +1 @@ +../../test/run-pytest \ No newline at end of file diff --git a/8.4/test/self-signed-ssl b/8.4/test/self-signed-ssl new file mode 120000 index 000000000..1c1fd1874 --- /dev/null +++ b/8.4/test/self-signed-ssl @@ -0,0 +1 @@ +../../examples/self-signed-ssl/ \ No newline at end of file diff --git a/8.4/test/test-app b/8.4/test/test-app new file mode 120000 index 000000000..e90082861 --- /dev/null +++ b/8.4/test/test-app @@ -0,0 +1 @@ +../../test/test-app/ \ No newline at end of file diff --git a/8.3/test/test-lib-openshift.sh b/8.4/test/test-lib-openshift.sh similarity index 100% rename from 8.3/test/test-lib-openshift.sh rename to 8.4/test/test-lib-openshift.sh diff --git a/8.3/test/test-lib-remote-openshift.sh b/8.4/test/test-lib-remote-openshift.sh similarity index 100% rename from 8.3/test/test-lib-remote-openshift.sh rename to 8.4/test/test-lib-remote-openshift.sh diff --git a/8.4/test/test-lib.sh b/8.4/test/test-lib.sh new file mode 120000 index 000000000..1ac99b93b --- /dev/null +++ b/8.4/test/test-lib.sh @@ -0,0 +1 @@ +../../common/test-lib.sh \ No newline at end of file diff --git a/8.3/test/test-openshift.yaml b/8.4/test/test-openshift.yaml similarity index 100% rename from 8.3/test/test-openshift.yaml rename to 8.4/test/test-openshift.yaml diff --git a/8.4/test/test_container_application.py b/8.4/test/test_container_application.py new file mode 120000 index 000000000..25c1c1ece --- /dev/null +++ b/8.4/test/test_container_application.py @@ -0,0 +1 @@ +../../test/test_container_application.py \ No newline at end of file diff --git a/8.4/test/test_container_basics.py b/8.4/test/test_container_basics.py new file mode 120000 index 000000000..b85dc1397 --- /dev/null +++ b/8.4/test/test_container_basics.py @@ -0,0 +1 @@ +../../test/test_container_basics.py \ No newline at end of file diff --git a/8.4/test/test_container_ssl.py b/8.4/test/test_container_ssl.py new file mode 120000 index 000000000..4257c4642 --- /dev/null +++ b/8.4/test/test_container_ssl.py @@ -0,0 +1 @@ +../../test/test_container_ssl.py \ No newline at end of file diff --git a/8.4/test/test_ocp_php_deploy_templates.py b/8.4/test/test_ocp_php_deploy_templates.py new file mode 120000 index 000000000..986c85f30 --- /dev/null +++ b/8.4/test/test_ocp_php_deploy_templates.py @@ -0,0 +1 @@ +../../test/test_ocp_php_deploy_templates.py \ No newline at end of file diff --git a/8.4/test/test_ocp_php_latest_imagestreams.py b/8.4/test/test_ocp_php_latest_imagestreams.py new file mode 120000 index 000000000..26e4c91c8 --- /dev/null +++ b/8.4/test/test_ocp_php_latest_imagestreams.py @@ -0,0 +1 @@ +../../test/test_ocp_php_latest_imagestreams.py \ No newline at end of file diff --git a/8.4/test/test_ocp_php_s2i_imagestreams.py b/8.4/test/test_ocp_php_s2i_imagestreams.py new file mode 120000 index 000000000..a4a14529a --- /dev/null +++ b/8.4/test/test_ocp_php_s2i_imagestreams.py @@ -0,0 +1 @@ +../../test/test_ocp_php_s2i_imagestreams.py \ No newline at end of file diff --git a/8.4/test/test_ocp_php_s2i_integration.py b/8.4/test/test_ocp_php_s2i_integration.py new file mode 120000 index 000000000..b80ef5aef --- /dev/null +++ b/8.4/test/test_ocp_php_s2i_integration.py @@ -0,0 +1 @@ +../../test/test_ocp_php_s2i_integration.py \ No newline at end of file diff --git a/8.4/test/test_ocp_shared_helm_cakephp_application.py b/8.4/test/test_ocp_shared_helm_cakephp_application.py new file mode 120000 index 000000000..0e3fc630f --- /dev/null +++ b/8.4/test/test_ocp_shared_helm_cakephp_application.py @@ -0,0 +1 @@ +../../test/test_ocp_shared_helm_cakephp_application.py \ No newline at end of file diff --git a/8.4/test/test_ocp_shared_helm_chart_imagestreams.py b/8.4/test/test_ocp_shared_helm_chart_imagestreams.py new file mode 120000 index 000000000..45defea80 --- /dev/null +++ b/8.4/test/test_ocp_shared_helm_chart_imagestreams.py @@ -0,0 +1 @@ +../../test/test_ocp_shared_helm_chart_imagestreams.py \ No newline at end of file diff --git a/Makefile b/Makefile index 9a86ca324..54cb8648d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Include common Makefile code. BASE_IMAGE_NAME = php -VERSIONS = 7.4 8.0 8.2 8.3 +VERSIONS = 7.4 8.0 8.2 8.3 8.4 OPENSHIFT_NAMESPACES = # HACK: Ensure that 'git pull' for old clones doesn't cause confusion. diff --git a/README.md b/README.md index 493550f1c..b08e663c6 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Table start |8.0|||||
`registry.redhat.io/rhel9/php-80`
|| |8.2|||
`quay.io/fedora/php-82`
|
`registry.redhat.io/rhel8/php-82`
|
`registry.redhat.io/rhel9/php-82`
|| |8.3|
`quay.io/sclorg/php-83-c9s`
|
`quay.io/sclorg/php-83-c10s`
|
`quay.io/fedora/php-83`
||
`registry.redhat.io/rhel9/php-83`
|
`registry.redhat.io/rhel10/php-83`
| +|8.4||
`quay.io/sclorg/php-84-c10s`
|
`quay.io/fedora/php-84`
|||
`registry.redhat.io/rhel10/php-84`
| @@ -90,6 +91,9 @@ see [usage documentation](8.2/README.md). For information about usage of Dockerfile for PHP 8.3, see [usage documentation](8.3/README.md). +For information about usage of Dockerfile for PHP 8.4, +see [usage documentation](8.4/README.md). + Test ---- This repository also provides a [S2I](https://github.com/openshift/source-to-image) test framework, diff --git a/imagestreams/imagestreams.yaml b/imagestreams/imagestreams.yaml index 6b1a5e781..9a4d0021e 100644 --- a/imagestreams/imagestreams.yaml +++ b/imagestreams/imagestreams.yaml @@ -20,10 +20,10 @@ app_versions: ["8.0", "8.2", "8.3"] - name: UBI 10 - app_versions: ["8.3"] + app_versions: ["8.3", "8.4"] - filename: php-rhel.json - latest: "8.3-ubi10" + latest: "8.4-ubi10" distros: - name: UBI 8 app_versions: ["7.4", "8.2"] @@ -32,10 +32,10 @@ app_versions: ["8.0", "8.2", "8.3"] - name: UBI 10 - app_versions: ["8.3"] + app_versions: ["8.3", "8.4"] - filename: php-rhel-aarch64.json - latest: "8.3-ubi10" + latest: "8.4-ubi10" distros: - name: UBI 8 app_versions: ["7.4", "8.2"] @@ -44,5 +44,5 @@ app_versions: ["8.0", "8.2", "8.3"] - name: UBI 10 - app_versions: ["8.3"] + app_versions: ["8.3", "8.4"] ... diff --git a/imagestreams/php-centos.json b/imagestreams/php-centos.json index 7552e7164..49a1237b3 100644 --- a/imagestreams/php-centos.json +++ b/imagestreams/php-centos.json @@ -123,6 +123,25 @@ "type": "Local" } }, + { + "name": "8.4-ubi10", + "annotations": { + "openshift.io/display-name": "PHP 8.4 (UBI 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run PHP 8.4 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.4/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "version": "8.4", + "sampleRepo": "https://github.com/sclorg/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi10/php-84:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { diff --git a/imagestreams/php-rhel-aarch64.json b/imagestreams/php-rhel-aarch64.json index 2565b7034..55a217d71 100644 --- a/imagestreams/php-rhel-aarch64.json +++ b/imagestreams/php-rhel-aarch64.json @@ -123,20 +123,39 @@ "type": "Local" } }, + { + "name": "8.4-ubi10", + "annotations": { + "openshift.io/display-name": "PHP 8.4 (UBI 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run PHP 8.4 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.4/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "version": "8.4", + "sampleRepo": "https://github.com/sclorg/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi10/php-84:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "PHP 8.3 (Latest)", + "openshift.io/display-name": "PHP 8.4 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run PHP 8.3 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.3/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run PHP 8.4 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-php", "tags": "builder,php", - "version": "8.3", + "version": "8.4", "sampleRepo": "https://github.com/sclorg/cakephp-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "8.3-ubi10" + "name": "8.4-ubi10" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/php-rhel.json b/imagestreams/php-rhel.json index 2565b7034..55a217d71 100644 --- a/imagestreams/php-rhel.json +++ b/imagestreams/php-rhel.json @@ -123,20 +123,39 @@ "type": "Local" } }, + { + "name": "8.4-ubi10", + "annotations": { + "openshift.io/display-name": "PHP 8.4 (UBI 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run PHP 8.4 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.4/README.md.", + "iconClass": "icon-php", + "tags": "builder,php", + "version": "8.4", + "sampleRepo": "https://github.com/sclorg/cakephp-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi10/php-84:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "PHP 8.3 (Latest)", + "openshift.io/display-name": "PHP 8.4 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run PHP 8.3 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.3/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run PHP 8.4 applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-php-container/blob/master/8.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-php", "tags": "builder,php", - "version": "8.3", + "version": "8.4", "sampleRepo": "https://github.com/sclorg/cakephp-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "8.3-ubi10" + "name": "8.4-ubi10" }, "referencePolicy": { "type": "Local"