- Documentation
- Technologies
- PHP
PHP
Guara Cloud fully supports PHP applications, including frameworks like Laravel, Symfony, and plain PHP projects running with Apache or Nginx.
Supported versions
The following PHP versions are auto-detected:
- PHP 8.1
- PHP 8.2
- PHP 8.3
The version is auto-detected from the require.php field in your composer.json.
{
"require": {
"php": ">=8.3"
}
}
Deploy with Dockerfile
For full control over your build, provide a Dockerfile in the root of your repository. PHP applications typically use Apache or Nginx + FPM as a process manager.
Deploy with Buildpack
If your repository does not contain a Dockerfile, Guara Cloud automatically detects your PHP project by the presence of a composer.json or index.php file.
The auto-detection will:
- Detect the PHP version from
composer.json - Run
composer installautomatically - Detect Laravel projects with first-class support (artisan caching, FrankenPHP + Caddy)
- Configure Caddy as the web server automatically
- Start the application
Port configuration
Your PHP application does not read the port directly in code — the web server (Apache or Nginx) must be configured to listen on the port configured in your service settings. The default is 3000, but you can change it at any time.
For Apache, update your virtual host or use the $PORT variable in configuration:
Listen ${PORT}
<VirtualHost *:${PORT}>
DocumentRoot /var/www/html/public
</VirtualHost>
For Nginx, update your server block:
server {
listen ${PORT};
root /app/public;
index index.php;
}
Example project structure
my-php-app/
composer.json
composer.lock
public/
index.php
src/
Controllers/
Models/
Dockerfile # optional — omit to use Buildpack
Environment variables
These environment variables are commonly used with PHP deployments:
| Variable | Recommended value | Description |
|---|---|---|
APP_ENV | production | Sets the application environment (Laravel/Symfony) |
PORT | Set by platform | The port your web server must listen on |
APP_KEY | Your key | Required by Laravel for encryption |
APP_DEBUG | false | Disables debug mode in production |