PHP comes in three flavours on Falix, and picking the right one is most of the battle. They're separate applications with different startup behaviour: one for plain scripts, one for scripts with Composer dependencies, and one for full websites served by nginx. This guide covers all three and helps you choose.
| At a glance | |
|---|---|
| You need | A Falix server running one of the PHP applications |
| Plan | Any — on free it runs while your session timer has time left, premium runs 24/7 |
| Time | Fifteen minutes |
| No server yet? | Create your first app server |
Which PHP application?
| Application | Runs | Dependencies | Pick it for |
|---|---|---|---|
| PHP CLI | php index.php and nothing else |
None — a composer.json is ignored |
Standalone scripts and workers with no external libraries |
| PHP Composer | composer install first (if a composer.json exists), then your PHP file |
Installed for you on every start | Command-line apps and bots that do have dependencies |
| PHP Web Server | nginx and PHP-FPM together, serving a web root over your public port | Composer doesn't run — you provide vendor/ |
Actual websites |
You choose the application when you create the server. All three run PHP 8.3.
⚠️ Heads up: Switching a running server to a different application reinstalls it and wipes its files (the panel warns you first), so decide up front.
PHP CLI and PHP Composer
Both run a single PHP entry file, set by the PHP File variable on the Settings page (default index.php). The only difference is dependencies:
- On PHP CLI, there's no install step. What you upload is what runs. Good for a self-contained script.
- On PHP Composer, if a
composer.jsonis present,composer installruns automatically on every start before your code — so yourvendor/folder is built for you from the lockfile. Editcomposer.json, restart, watch it install.
Here's a minimal index.php that keeps a worker alive and logs to the console:
<?php
while (true) {
echo "worker tick at " . date("H:i:s") . PHP_EOL;
sleep(60);
}
PHP Web Server
This application serves a website: nginx sits in front, PHP-FPM runs your code, and the public root is the folder named by the Web Root variable (default public). Your public/index.php becomes your homepage, reachable at your server's address (Network page) with no code changes to bind a port — the web server wires SERVER_PORT up for you.
Start from the template. Deploy the PHP Website template on this page before anything else. A fresh PHP Web Server's default configuration doesn't fill in your port, which leaves nginx crash-looping on startup — you'll see it fail to boot in the console. The template ships a corrected web-server config alongside a working public/ folder, so deploying it is the reliable way to get a serving website. Treat it as step one, not a fallback.
🎯 Good to know: Composer does not run on the Web Server application. If your site needs a
vendor/folder, you have two choices — uploadvendor/along with your code, or connect the Git page and add acomposer installpost-deploy command that builds it after each deploy.
Adding dependencies
All three PHP applications have a Packages page in the server menu, and it's the easiest way to manage libraries. Open Packages, type the package name into the Install package panel, and press Install — behind the scenes it runs composer require, updates your composer.json for you, and shows the job under Tasks. Restart afterwards so your app loads the new library. The page also lists your current dependencies, flags outdated ones, and warns about known vulnerabilities.
Hand-editing composer.json still works too (and is what Git-based projects do) — just remember that on the CLI and Web Server applications, you are responsible for producing vendor/, whereas the Composer application rebuilds it on every start.
A different file, several apps, and reinstalls
On CLI and Composer the entry point is the PHP File variable — point it at any .php file. To run a genuinely separate app, don't switch back and forth destructively: give it its own Instance, an isolated application, files, and startup on the same server, switched whenever you like.
⚠️ Heads up: A reinstall — or switching to another application — can wipe your files,
vendor/included. On PHP Composer that's harmless:composer installrebuildsvendor/on the next start. On PHP CLI and PHP Web Server nothing reinstalls it for you, so you'll need to re-uploadvendor/or rebuild it with a Gitcomposer installpost-deploy command.
Verify it works
- CLI / Composer: the console shows your script's output. A worker keeps printing; a one-shot script prints and exits cleanly (a stopped server there is normal, not a crash).
- Web Server: open your server's address in a browser and your page loads. If nginx is healthy, the console stays quiet instead of restarting in a loop.
When things go wrong
- nginx keeps restarting with
host not found in "SERVER_PORT"— the default web config never got your port. Deploy the PHP Website template, which ships the corrected config. Class "..." not found/ Composer autoload errors — yourvendor/folder is missing. On the Composer application, check thecomposer installoutput at the top of the console; on the Web Server application, uploadvendor/or add a Git post-deploycomposer install.- Site loads but shows raw PHP or a blank page — your files aren't in the Web Root, or the entry file isn't
index.php. Check the Web Root variable and where you uploaded your code. - Can't reach the site at all — a port or address issue: I can't reach my app.
| Cheat sheet | |
|---|---|
| Entry file | index.php (PHP File variable) on CLI/Composer; Web Root public on Web Server |
| Dependencies | Packages page runs composer require; auto-installed only on PHP Composer |
| Web port rule | The Web Server wires SERVER_PORT up for you — no code needed |