Deploy a PHP Application with CI
TMXIO deploys generic PHP applications as immutable release artifacts. Build the application and its production dependencies in CI, upload one tar.gz file, and ask TMXIO to activate that exact artifact. Choose the target Website Environment first. Deploy history, cancellation, rollback and generated scripts stay scoped to that environment.
TMXIO does not run Composer or frontend builds while unpacking the artifact. Configured framework profiles perform required runtime bootstrap independently of custom release commands. The uploaded release must already contain everything the application needs to serve traffic.
Configure the Website Environment
Section titled “Configure the Website Environment”Open the selected Website Environment and review PHP runtime:
- Select the PHP version your application supports. TMXIO runs exactly that version and never substitutes another; a version the region does not offer is rejected when you save it. A retired PHP version is no longer offered; an environment already running one keeps it until you select a newer version, and cannot switch back afterwards.
- Set Public root to the directory containing the public entry point. Laravel and Symfony commonly use
public. Enter.only when the entry point sits at the top of the release; an empty Public root is rejected rather than treated as the release root. - Choose Front controller for frameworks that route requests through
index.php. Choose Direct files only when requests map directly to PHP files. - Set Health path to a fast public route that returns HTTP 200 without depending on optional services.
- Add an optional Release command only when activation requires a bounded command such as
php artisan migrate --force. - Under PHP settings, leave the memory limit, maximum input variables, OPcache memory, and OPcache interned strings fields empty to inherit platform defaults. Set an override only when this environment needs a different value. Saving an effective change reconciles this environment’s PHP-FPM pool and may briefly interrupt in-flight PHP requests.
- Save application configuration under Environment variables. Store credentials and application keys as secrets.
- Under Domains, select Add domain, enter the fully qualified domain name (FQDN) that should serve the application, and follow the displayed DNS instructions.
- Copy the numeric Environment ID from the footer of About this environment. CI uses it to pin uploads and deploys to this exact Website Environment.
Release commands run after extraction and before activation. If the command fails, TMXIO rejects the candidate release and keeps the previous release active. Database changes must remain compatible with that rollback boundary.
Generate the deploy token
Section titled “Generate the deploy token”Under Artifact deploy token, select Generate token. Save the token immediately: TMXIO displays it only once.
In GitLab, add a protected and masked CI/CD variable named:
TMXIO_ARTIFACT_DEPLOY_TOKENThe generated script embeds the selected Website and Environment IDs, never the token value.
The token is scoped to the Website Environment. Rotate it when it is exposed or when CI ownership changes. Rotation immediately invalidates the previous value.
Package the release
Section titled “Package the release”The release archive should contain the application at its root, including:
- the public entry point under the configured Public root;
- production Composer dependencies in
vendor/; - built frontend assets;
- writable-directory placeholders required by the framework.
Do not include .env files, credentials, Git history, development dependencies, test output, or local caches. Configure runtime values in TMXIO instead.
Generate a deployment script
Section titled “Generate a deployment script”From Deploys, select Deployment scripts and setup. Choose Global / auto-detect, Laravel, CodeIgniter 4, or Plain PHP, then select Bash or GitLab CI. Copy or download the generated script. Selecting an option does not alter the environment.
Run Bash from the project root. The GitLab snippet requires a runner with Bash, the selected PHP version and extensions, Composer when the project uses it, curl 7.76 or newer, jq, tar, and the project’s frontend tools. Keep the project’s Composer lockfile. Frontend builds require exactly one supported npm, pnpm or Yarn lockfile. Ambiguous frameworks stop with an explicit selection message. Custom layouts require application-specific configuration.
The script builds in a temporary directory, excludes secrets and live data, validates the document root, uploads through the existing artifact API and waits for terminal deployment health. Failures and timeouts return a nonzero exit code. The original checkout is unchanged. Composer scripts are not executed automatically; review any application-specific build steps separately. Application keys and migrations are never generated or run by the script.
Check versions before deploying from a local folder
Section titled “Check versions before deploying from a local folder”The PHP requirement in composer.json is only one constraint. Locked dependencies in composer.lock may require a newer version, especially when Composer’s config.platform.php differs from your local PHP. For example, a project declaring ^8.3 can still lock a dependency that requires PHP 8.4 or newer. Choose a supported environment version that satisfies the lockfile, use the same PHP major/minor locally, and regenerate the deployment script after saving the environment version. Do not use --ignore-platform-reqs to force an incompatible build.
Run composer check-platform-reqs --no-dev against installed production dependencies to check the actual local PHP and extensions. The generated script repeats this check after its locked installation.
If package.json has a build command but no lockfile, create and review the lockfile with your chosen package manager before deploying. For npm, use npm install --package-lock-only --ignore-scripts, then retain package-lock.json in your project. The generated script intentionally does not guess a package manager or resolve new dependency versions during deployment.
API rejections print the server’s error explanation and exit unsuccessfully. A rejection before deployment admission creates no Deploys row. For a newly created environment, wait for provisioning and its runtime capability report before deploying with persistent storage. Supply Laravel’s application key and required runtime variables separately; .env is excluded from the artifact.
Apply framework storage setup
Section titled “Apply framework storage setup”Review Proposed runtime setup, then select Apply setup and verify your passkey. The script continues using saved settings until setup succeeds; regenerate it afterward.
- Laravel uses
public, front-controller routing and astorage→ durablestoragemapping. - CodeIgniter 4 uses
public, front-controller routing and awritable→ durablewritablemapping. - Plain PHP keeps your selected document root and explicit persistent-path mappings. Upload locations are not guessed.
- SQLite outside a mapped directory requires an explicit File mapping. Initialize the database independently; a missing database is rejected rather than replaced with an empty one.
A live setup runs through the existing backup and transfer coordinator: safety capture, worker/job pause, retained release and data checkpoints, conflict checks, migration, activation and HTTP health. Conflicting destination data is rejected. Failures recover the previous settings, files and release; failed recovery keeps the environment stopped. Progress is visible in Environments. Existing mapped paths cannot be remapped to a different data path by setup.
Storage mappings become part of new immutable backup runtime metadata. Deployments, full restores, transfers and rollback apply the mapping before framework setup. Full restores skip custom release commands. Historical backups retain their recorded metadata; no storage profile is guessed. Public upload exposure still needs separate platform approval.
Laravel runs package discovery and clears compiled views; CodeIgniter clears its optimization caches. Neither operation runs migrations. The server needs the PHP persistent-storage capability before this setup can be applied. Older nodes continue serving unchanged configurations.
See the framework deployment requirements for Laravel and CodeIgniter 4. External credentials, application-specific bootstrapping, and arbitrary hardcoded paths remain the application’s responsibility.
Verify the deployment
Section titled “Verify the deployment”Open Deploys and follow the new release until it reaches Healthy or Failed. A queued or running deploy is not complete. Earlier successful PHP releases keep their historical Healthy outcome after a newer release replaces them. Live runtime-health warnings apply to the current successful release.
After TMXIO reports Healthy:
- Open the public Website domain.
- Request the configured health path.
- Check application routes that depend on environment variables or databases.
- Review the release-command output when a command was configured.
If activation fails, open the failed deploy to read the failed phase and error tail. Correct the build or configuration and upload a new artifact. Use rollback only to reactivate an artifact that was previously deployed successfully.
Copy between environments
Section titled “Copy between environments”Use Environment Transfer to activate a healthy PHP release in another environment, optionally copying data and application settings. New staging/dev environments automatically initialize from production. Applications with the Laravel profile (or existing generic PHP environments with a supported Laravel APP_KEY) receive a separate generated key, their own URL and environment name, and basic nonsecret application settings automatically. Supply any other application credentials separately; missing configuration produces a retryable failure. The separate key cannot decrypt values encrypted with production’s key.
Backups and restores
Section titled “Backups and restores”New complete backups pin the healthy PHP release actually serving at capture,
along with persistent data and any linked Managed Database captures. A download
contains app/, data/, databases/ when applicable, and manifest.json.
Database captures can be reused for up to 24 hours; their timestamps appear
individually. Request fresh managed captures when you need a new database boundary.
Full restores activate the pinned release and check runtime health without running the custom release command. Managed database restore is optional and unchecked by default; managed database refresh during production-to-staging/dev transfers requires explicit selection and overwrite confirmation. See Back Up and Restore a Website.
PHP variable names are case-sensitive. CodeIgniter 4 can use app_baseURL;
new staging and development copies receive their own URL and production-mode
error handling. Arbitrary credentials are still configured separately.
The hosting PHP packages include SQLite support. Applying these changes to an older node requires its normal package/configuration update before using SQLite applications or persistent-storage setup.