Run any PHP application
Deploy a plain PHP project by choosing its web root, persistent paths, and scheduled tasks.
Run any PHP application
Choose PHP application when your repository is not Laravel or WordPress. You provide the few details that vary between PHP projects; strackt handles the server, deploys, and later releases.
Choose the web root
Set the Web root while creating the application. This is the directory that contains the entry point visitors should reach:
- Use
publicwhen the entry point ispublic/index.php. - Use a directory such as
pwhen the entry point isp/index.php. - Leave the field empty when
index.phpis in the repository root.
Enter a path relative to the repository, without a leading slash.
Complete a web installer on the first run
If the application has a web installer, deploy it once, open its URL, and complete that installer. This lets the application collect its settings and create its initial files in the normal way.
Make a note of any files or directories the installer writes that must survive a new release. Add those paths under Settings → Runtime → Persistent paths before the next deploy. That deploy keeps the existing contents and preserves the same paths across later releases.
Keep files between releases
Persistent paths are relative to the repository. Common examples are data,
config, and public/uploads.
Add each independent path once. Do not use an absolute path, ., a trailing slash,
or both a parent and one of its children. For example, choose either data or
data/cache, not both.
Run scheduled tasks
Under Settings → Runtime → Scheduled tasks, add a one-line command and a five-field cron schedule in UTC. For example:
Command: php app/actualize_script.php
Schedule: 0 * * * *
This runs once an hour from the repository root of the current release. A command
can use quotes, pipes, and &&.
PHP (php), Composer (composer), Git (git), and unzip are available by name.
Node (node) is also available when the application has a Node version configured.
Use an absolute executable path when a command needs another installed program.
Remove a task and save the list when it should no longer run.
Was this helpful?