Skip to main content
Betadocs
DocsStatusSupportPricing
  • Introduction
    • Introduction to Webgune
    • How Webgune works
    • Creating an account
    • Creating your first project
    • Exploring the dashboard
  • Deployment

    • Deploying from GitHub
    • Deploying a Docker image
    • How builds work
    • Deployments and rollback
    • Environment variables
    • Custom start command
    • Health check
    • Database migrations

    Web apps

    • Web applications
      • Supported frameworks
      • Next.js
      • React / Vite
      • Node.js
      • Python
      • PHP
      • Go

    Bots & workers

    • Discord bots
    • Workers

    Docker

    • Docker
      • Writing a Dockerfile
      • Public Docker images

    Databases

    • Databases
      • PostgreSQL
      • MySQL
      • MariaDB
      • MongoDB
      • Redis

    Observability

    • Logs and monitoring
    • Web terminal

    Scaling

    • Availability and scaling
    • Persistent volumes
    • Backups and restore
    • Sleep mode

    Platform

    • One microVM per service
    • Network and isolation
    • Platform security
    • Deploying a template
      • Template catalog
    • Free subdomains
    • Custom domains
    • Buying a domain
    • Hosting DNS for a domain bought elsewhere
    • Managing your DNS records
    • SSL certificates
    • Redirects
    • Shared projects
      • Roles and permissions
    • Real-time collaboration
    • Continuous deployment
      • The kx712.yml file
    • VS Code extension
    • Plans and pricing
    • Payments and invoices
    • Account or per-project subscription
    • API reference
    • API keys
    • Webgune CLI
    • MCP server
    • JavaScript / TypeScript SDK
    • Support tickets
    • Status page
    • AI assistant
    • FAQ
    • Limits and resources
    • Account security
    • Best practices
    • Troubleshooting

Services / Web applications

PHP

Open as Markdown

A repository is built as a PHP project if it contains a composer.json with a recognized framework, an artisan file, or an index.php at the root or in public, web, webroot, html or www.

The image

ItemValue
Imagephp:<version>-cli-alpine
Versionthe one requested by require.php in composer.json, 8.3 by default
ServerPHP built-in server (php -S, php artisan serve)
Composerversion 2
Variable setAPP_ENV=production

There is no Apache and no PHP-FPM. The built-in server handles one request at a time per process: for a very busy site, increase the number of instances (Availability and scaling) or use a Dockerfile with Nginx and PHP-FPM.

Extensions

Always installed: opcache, pdo_mysql, pdo_pgsql, zip, bcmath, intl. In addition:

  • each ext-* declared in require or require-dev of composer.json ("ext-gd": "*", "ext-redis": "*");
  • gd and exif for Laravel;
  • mysqli, gd, exif and imagick for WordPress.

Extensions already present in PHP (mbstring, json, curl, openssl, pdo, sqlite3, xml...) do not need to be declared.

Installing dependencies

composer install --no-dev --prefer-dist --no-interaction --no-scripts --no-autoloader
# copy of the code
composer dump-autoload --optimize --no-dev

composer.lock is used if it is committed, and it is recommended: without it, Composer resolves versions on every build. Composer scripts (post-install-cmd, post-autoload-dump) are not run. require-dev dependencies are not installed.

For a private Composer repository, create the COMPOSER_AUTH variable in the Variables panel. It is passed to dependency installation.

{"github-oauth": {"github.com": "ghp_your_token"}}

Frameworks and commands

FrameworkStart command
Laravel, Statamicphp artisan serve --host=0.0.0.0 --port=$PORT
Symfony, Slim, Lumen, Laminasphp -S 0.0.0.0:$PORT -t public
CodeIgniter 4php spark serve --host 0.0.0.0 --port $PORT
CakePHPbin/cake server -H 0.0.0.0 -p $PORT
Yii 2php -S 0.0.0.0:$PORT -t web
Craft CMS, Drupal, Kirbyphp -S 0.0.0.0:$PORT -t <web root>
WordPress, Gravphp -S 0.0.0.0:$PORT -t .
PHP without a frameworkphp -S 0.0.0.0:$PORT -t <web root>

The web root is the first folder among public, web, webroot, html and www that contains an index.php, otherwise the repository root.

Laravel

Variables to plan for:

APP_ENV=production
APP_KEY=base64:generated-value
APP_DEBUG=false
APP_URL=https://www.example.com
LOG_CHANNEL=stderr

DB_CONNECTION=mysql
DB_HOST=database-internal-address
DB_PORT=3306
DB_DATABASE=app
DB_USERNAME=app
DB_PASSWORD=password

CACHE_STORE=redis
SESSION_DRIVER=redis
REDIS_URL=redis://redis-internal-address:6379

A database's internal address is read in the Database panel of the database service (Databases).

  • Generate APP_KEY only once, locally, with php artisan key:generate --show, then copy the value into the variables. A new key invalidates existing sessions and encrypted data.
  • LOG_CHANNEL=stderr sends Laravel logs to the Logs tab. With the default channel, they are written to storage/logs, which is wiped on every restart.
  • Files uploaded by your users (storage/app) must go on a persistent volume or S3-compatible storage.
  • Behind Webgune, Laravel must trust the proxy to generate HTTPS addresses. In Laravel 11, bootstrap/app.php: $middleware->trustProxies(at: '*');.

Since Composer scripts do not run at build time, run the preparation commands at startup, with a custom start command:

php artisan migrate --force && php artisan config:cache && php artisan route:cache && php artisan serve --host=0.0.0.0 --port=$PORT

Read Database migrations before running migrations at startup.

Vite assets

A Laravel project often has a vite.config.js. The build recognizes it as Laravel, not as a Vite site, but it does not run npm run build: Node.js is not in the PHP image. Two solutions: commit the public/build folder, or use a multi-stage Dockerfile, one stage with Node.js for the assets and one with PHP.

WordPress

A repository that contains wp-config.php, wp-load.php or wp-content/ is recognized as WordPress. Extensions and uploads written to disk disappear on restart: you need a persistent volume on wp-content/uploads.

The simplest remains the official wordpress image or the matching template (Public Docker images, Template catalog).

Replacing the command

A Procfile at the root replaces the generated command:

web: php -S 0.0.0.0:$PORT -t public public/router.php

Common errors

SymptomCauseWhat to do
could not find driverMissing PDO extensionDeclare "ext-pdo_sqlite": "*" or the extension you want in composer.json
No application encryption key has been specifiedAPP_KEY missingAdd the variable
Links and forms in http://Proxy not trustedtrustProxies(at: '*') and APP_URL in https://
Missing styles on LaravelVite assets not builtCommit public/build or use a Dockerfile
Uploaded files lost after an updateWritten to the service's diskPersistent volume
Unexpected PHP versionrequire.php constraint in composer.jsonAdjust the constraint, for example "php": "^8.3"

Updated on November 20, 2026

PythonPreviousGoNext

On this page

The imageExtensionsInstalling dependenciesFrameworks and commandsLaravelVite assetsWordPressReplacing the commandCommon errors
© 2026 WebguneBack to the site