Skip to main content

Managing PHP and Node runtimes

Switch PHP versions safely, run a Node app behind the proxy, and fix common runtime errors.

PHP versions

Different sites may need different PHP versions. The panel lets you set the version per site.

Before switching versions:

  1. Back up the site (files and database).

  2. Check your theme/plugins for compatibility — most modern software supports PHP 8.1+.

  3. Switch on a staging copy first if you have one.

  4. Switch, then immediately load the site and check the error log.

Common breakages after a major PHP bump: removed functions, stricter type warnings, and old extensions. The error log names the file and line — start there.

PHP settings worth knowing

  • memory_limit — raise it if a script dies with "allowed memory size exhausted".

  • max_execution_time — raise it for long imports or exports.

  • upload_max_filesize / post_max_size — raise both, together, for large uploads.

  • OPcache — leave it on; it is a straight performance win.

Change these per site rather than globally so one heavy app does not loosen limits for everyone.

Node.js apps

For a persistent Node process:

  1. Set the site runtime to Node.

  2. Give the panel a start command (e.g. node server.js or npm start) and the port your app listens on.

  3. We run it under a process manager and proxy requests to it.

Key points:

  • Bind to the port we give you (often via process.env.PORT), not a hard-coded one, and add that port to the proxy.

  • Never bind to port 80/443 yourself — the proxy owns those.

  • Environment variables (database URLs, API keys) go in the panel's env settings, not in committed files.

  • Builds run once at deploy; keep build tooling in devDependencies and production deps slim.

Common runtime errors

SymptomLikely cause
502 Bad GatewayApp crashed or not listening on the expected port
500 with empty bodyUnhandled exception at boot — check the app log
Works locally, not hereEnvironment variables missing, or a hard-coded port/path
Slow first requestCold start or a build running on first hit — use a warm start
"Port already in use"A previous process is still bound; restart the app from the panel

Related reading