Skip to main content

Choose a framework

When you create a PHP app, pick the framework:
  • Native PHP: the app folder is the web root.
  • Laravel, CodeIgniter 4 or CodeIgniter 5: Servbase serves the public/ folder, so .env and your application code are never served on the web. Dependencies are installed with composer install during deployment when vendor/ is missing or composer.lock changed.
You can change the folder that is served with the web root setting.

PHP version

Choose PHP 8.3, 8.4 or 8.5 when you create the app (step 3) or later in the app’s Settings tab under Runtime. A change applies right away, without a redeploy. If your Composer packages require another PHP version (for example “Your Composer dependencies require a PHP version >= 8.4.0”), switch the version and then Redeploy or run composer install in the Terminal, which uses the same version.

Web root

The web root is the folder inside your app that your domain serves. Set it when you create the app (step 3, Web server) or later in the app’s Settings tab under Web server. Changes apply right away, without a redeploy. Serving a public/ folder instead of the whole app keeps configuration files, vendor/ and your source code off the web. Use it for any app that ships a public/ folder, such as Symfony, Slim or EspoCRM.

Static folders

Some apps keep their front-end files outside the web root and expect the web server to serve them at the same path. List those folders under Static folders, separated by commas. For example, client is served at /client/. Files in a static folder are only ever sent as files: PHP scripts in them never run and are refused, and dotfiles are never served.

Front controllers in subfolders

When a request does not match a file, Servbase runs the nearest index.php up the request path, then the index.php of the web root. A request for /api/v1/users runs api/v1/index.php when it exists. This matches the .htaccess rewrite rules many apps ship for Apache, so they work without changes.

Example: EspoCRM

  1. Upload EspoCRM, or connect its repository, and choose Native PHP.
  2. Set the web root to public and the static folders to client.
  3. Under Persistent folders, add data and custom, so EspoCRM’s configuration, uploads and customizations survive redeploys.
  4. Open the app’s URL to start the EspoCRM installer.

Isolation

Each PHP app runs in its own PHP process pool, as its own system user, inside its own jail. An app can read and write only its own files. Dotfiles such as .env, .git and .htaccess are never served. For security, PHP functions that run programs (exec, system, shell_exec, proc_open, popen) are disabled, and outgoing HTTP requests from PHP are blocked.

Terminal

PHP apps have a Terminal tab. It runs as your app’s user in a sandbox with php and composer, so you can run commands such as php artisan migrate or composer require.

Environment variables

Store secrets in the app’s Settings tab rather than committing them to your repository.

Updating files

PHP apps connected to GitHub redeploy automatically on every push to their branch, keeping .env, storage/, writable/ and vendor/ from the running app. The new release is prepared beside the running one and switched in when it is complete, so visitors never see a half-updated app. To re-clone the branch by hand, for example after changing files in the file manager that you want to discard, click Redeploy on the app’s page. Changes made in the file manager that are not pushed to GitHub are replaced, so push them first from the file manager’s source control panel if you want to keep them. Folders your app writes to, such as uploads, are kept across redeploys when you list them under Persistent folders. Apps uploaded without GitHub are updated live through the file manager.