Default Configurations

serversideup/php is configured for real-world deployments right out of the box. This saves you many hours so you can launch faster than ever.

Production-ready and optimized for Laravel & WordPress

All values are defaulted to improve security and performance. We also spent the time to carefully review official documentation and include packages that are required specifically for Laravel and WordPress.

Default Environment Variables

We allow the ability to customize the behavior of PHP with environment variables. Be sure to review our production-ready default values on our environment variable specification page.

Default PHP Extensions

The following extensions are installed by default:

ExtensionDescriptionWhy we included it
opcacheThe Zend OPcache provides faster PHP execution through opcode caching and optimization.This is a must-have for PHP performance.

⚠️ OPcache is disabled by default but can easily be enabled with PHP_OPCACHE_ENABLE=1.
mysqliThe "MySQL Improved" extension is an older extension for connecting to MySQL 4.1 and above.Enabled for fpm-apache only. This is a legacy MySQL connector required for WordPress.
pcntlProcess Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination.This is required for Laravel queues and Laravel Horizon
pdo_mysqlThe MySQL PDO extension allows you to connect to MySQL databases.MySQL and MariaDB databases are very popular.
pdo_pgsqlThe PostgreSQL PDO extension allows you to connect to PostgreSQL databases.PostgreSQL databases are very popular.
redisThe Redis extension allows you to connect to Redis databases.Redis is very popular for caching and it's also required for Laravel Horizon. Our tests concluded adding this package only added 2MB to the image size.
zipThe Zip extension allows you to create and extract zip files.We included this for the popularity of apps working with ZIP files. This package is also required if you're working with attachments on Laravel Dusk.

The official PHP images are already providing the following extensions:

  • ctype
  • curl
  • dom
  • fileinfo
  • filter
  • hash
  • mbstirng
  • openssl
  • pcre
  • session
  • tokenizer
  • xml

Default Operating System Packages

The following packages are installed by default:

PackageDescriptionImage variationsWhy we included it
fcgi
(Debian)
libfcgi-bin
(Alpine)
FastCGI is a protocol for interfacing interactive programs with a web server.*-fpm-nginx
*-fpm-apache
This is required for the webserver to interface with PHP-FPM
gettext (Debian)
gettext-base (Alpine)
GNU gettext is a framework for translating user interfaces.*-fpm-nginx
*-fpm-apache
This is required for the envsubst command. We use this command to process templates on container initialization.
shadowShadow is required for the usermod command.*-alpineThis is required to change the UID and GID of the www-data user in docker-php-serversideup-set-id.

Default Entrypoint Scripts

We created an entrypoint script that scans the entrypoint.d directory for other shell scripts to execute before the main container process starts. All scripts are executed in alphabetical order so you can have full control over what script execution order.

We also provide a few default scripts to help you get started.

Script NameDescriptionImage variations
0-container-info.shShows basic execution information, such as Docker User, UID, GID, etc.all
1-debug-mode.shSets PHP to debug mode if LOG_OUTPUT_LEVEL = "debug"all
10-init-unit.shProcesses Unit templates, configures SSL (if enabled), and prepares NGINX Unit for launchunit
10-init-webserver-config.shProcesses web server configuration templates, configures SSL (if enabled), and prepares web server for launch*-nginx
*-apache
50-laravel-automations.shIf AUTORUN_ENABLED is set to true, and a Laravel installation is detected, the following commands will automatically execute on container start:
- php artisan config:cache
- php artisan route:cache
- php artisan view:cache
- php artisan event:cache
- php artisan migrate --force --isolated
all

Disabling Default Entrypoint Scripts

If you want full control to customize your image, all default entrypoint scripts can be disabled by setting DISABLE_DEFAULT_CONFIG to true.