PHP
Updated
🐘
Not just a mammal, a runtime.
The PHP component sets the memory and the number of PHP processes of a fortrabbit environment, and with them how many requests it answers at once. Its plan also sets the MySQL connections.
Booking
Choose the PHP plan when creating an app or an environment, and change it later on the components page of the environment.
Configuration
The PHP settings of each environment set the version, extensions and ini values. The metrics and logs show how PHP performs.
Scaling
PHP plans differ in memory and in the number of PHP processes. Start small and scale when the metrics ask for it: PHP memory near the plan line, OOM kills, or 503 errors when all processes are busy. See PHP processes.
Autoscaling
PHP does not autoscale. A traffic peak or a slow script would otherwise set the bill, so the PHP plan stays where it is booked.
Starting points
XS and SM cover most websites. Starting points from experience:
| Software | PHP memory |
|---|---|
| Craft CMS, October CMS | 512 MiB |
| WordPress, Kirby, Grav, Statamic | 256 MiB |
| Laravel, Filament | 256 MiB |
The real need depends on visitors, plugins, configuration and custom code, see the performance section.
MySQL connections for PHP
The PHP plan sets the number of MySQL connections: one per PHP process, plus some for jobs and database clients.
| PHP plan | PHP processes | MySQL connections |
|---|---|---|
| XS | 2 | 8 |
| SM | 2 | 8 |
| MD | 4 | 12 |
| LG | 6 | 16 |
| XL | 8 | 20 |
| 2XL | 12 | 28 |