PHP
Comprehensive information about PHP app configuration.
Common Settings
The section outlines common settings and behaviours for PHP projects.
PHP Version
Currently, PHP 8.2 is used for all PHP frameworks. The base image is
php:8.5-fpm.
Build Process
PHP apps on Viduli use a single container with PHP-FPM and Nginx running together via Supervisor.
Laravel
- Base distribution: Debian
- PHP version: 8.2
- Default image:
php:8.5-fpm - Included packages:
librabbitmq-dev libpq-dev libpng-dev libonig-dev libxml2-dev zip unzip ca-certificates procps git curl wget nano nginx supervisor - PHP extensions:
mbstring gd pcntl opcache pdo pdo_mysql redis
Build dependencies
Dependencies are installed using Composer with the following command
composer install \
--no-interaction \
--prefer-dist \
--optimize-autoloader \
--no-devEnvironment
The following environment variables are set:
DB_DATABASE=/tmp/test-db.sqlite- Temporary database path (for testing convenience)
Additional secrets cannot be passed to the build at the moment.
Runtime environment variables can be set by adding secrets.
File Permissions
The storage and bootstrap/cache directories are made writable for Laravel's
file operations by mounting a temporary drive. It uses the same drive as /tmp
so space is limited to 1GiB.
Symfony
- Base distribution: Debian
- PHP version: 8.2
- Default image:
php:8.5-fpm - Included packages:
librabbitmq-dev libpq-dev libpng-dev libonig-dev libxml2-dev zip unzip ca-certificates procps git curl wget nano nginx supervisor - PHP extensions:
mbstring gd pcntl opcache pdo pdo_mysql redis
Build dependencies
- First installs PHP dependencies using Composer.
- Installs Node.js LTS (
.node-versionsupport is not available yet) - Builds frontend assets (if package.json exists)
- Installs Symfony assets using
php bin/console assets:install public
Build command
No explicit build command is run by default. Composer scripts and asset builds are executed during the dependency installation phase.
Runtime
The application runs with:
- PHP-FPM executing the PHP application
- Nginx reverse proxying to PHP-FPM
- Supervisor managing both processes
Environment
The following environment variables are set:
APP_ENV=prod- Production environmentAPP_DEBUG=0- Debug mode disabledAPP_CACHE_DIR=/tmp/symfony/cache- Cache directoryAPP_LOG_DIR=/tmp/symfony/log- Log directory
By default, PORT is set to 8888. If you set an expose port value in the
resource build configuration, the nginx configuration is updated accordingly.
Secrets added to the resource are also available in the environment during the image build and run stages.
Last updated on