Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ Application root is `/app`. Application runs as user `application` (uid=1000).
| `ENV` | ssh | | The name of the environment to show on the shell prompt |
| `PHP_INI_OVERRIDE` | fpm, ssh | | Allow overriding php.ini settings. Simply the multiline content for a php.ini here. Use "\n" for multiline i.e. in ECS |
| `PHP_FPM_OVERRIDE` | fpm | | Allow overriding php-fpm pool settings. The multiline content for php-fpm.conf here. Use "\n" for multiline i.e. in ECS |
| `PHP_DISABLE_EXTENSIONS` | fpm, ssh | | Comma separated list of PHP extensions to disable. |

## Example usage

Expand Down
4 changes: 4 additions & 0 deletions example-app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ DB_NAME=typo3
# PHP settings overrides (examples)
# -----------------------------------------

# See full list here:
# https://github.com/cron-eu/docker-phpapp-php/blob/master/README.md#php-fpm-image-croneuphpapp-fpm
#PHP_DISABLE_EXTENSIONS=igbinary,redis

PHP_INI_OVERRIDE="
upload_max_filesize = 256M
post_max_size = 256M
Expand Down
20 changes: 19 additions & 1 deletion files/entrypoint-extras.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,28 @@ if [ -z "${XDEBUG_MODE}" ] || [ "${XDEBUG_MODE}" = "off" ]; then
# completely not load xdebug if its off
rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
else
echo "* enabling XDEBUG: $XDEBUG_MODE"
echo "* Enabling XDEBUG: $XDEBUG_MODE"
echo "zend_extension=xdebug.so" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
fi

# Enable all extensions which might have been disabled at some point first
if ls /usr/local/etc/php/conf.d/*php-ext*.disabled 1> /dev/null 2>&1; then
for file in /usr/local/etc/php/conf.d/*php-ext*.disabled; do
mv "$file" "${file%.disabled}"
done
fi
# Disable extensions based on PHP_DISABLE_EXTENSIONS
if [ ! -z "${PHP_DISABLE_EXTENSIONS}" ]; then
for ext in $(echo $PHP_DISABLE_EXTENSIONS | sed -e 's/,/ /g'); do
if [ -f "/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini" ]; then
echo "* Disabling PHP extension: $ext"
mv /usr/local/etc/php/conf.d/docker-php-ext-$ext.ini /usr/local/etc/php/conf.d/docker-php-ext-$ext.ini.disabled
else
echo "* WARNING: PHP extension $ext not found, cannot disable"
fi
done
fi

if [ ! -z "${APPLICATION_UID}" ]; then
echo "* Change uid of 'application' user to $APPLICATION_UID"
usermod -u $APPLICATION_UID application
Expand Down