Install the CLI. See the install docs.
Log in:
runway login
Add an SSH key. See key setup, or use the shortcut:
runway local key setup
Way back, PHP was designed to be a language without framework.
Since then, lots of frameworks have been created with Laravel and Symfony being among the most popular today.
Despite the availability of frameworks, you can still use PHP without them - and here is what you must do to deploy your no-framework application on Runway.
Create the project:
mkdir no-framework-app && cd no-framework-app
All you need is a web server. Imagine the following file tree:
.
└── htdocs
└── index.php
This is by far the most basic example we can come up with.
The index.php could be the following:
<?php
phpinfo(INFO_ALL & ~INFO_ENVIRONMENT & ~INFO_VARIABLES);
runway app config set FOO=bar you can use getenv("FOO") in your PHP code later. The above PHP info is displayed with $_ENV and $_SERVER removed, not to expose or leak your configuration.Configure your application to use Apache (php-fpm will come on its own):
runway app config set BP_PHP_SERVER=httpd
[build]
[[build.env]]
name="BP_PHP_SERVER"
value="httpd"
Deploying this example will show you a phpinfo() which displays the installed PHP version and the PHP extensions which are enabled by default.
Create the app on Runway (this also initializes a git repository, if none exists yet), then commit your changes:
runway app create
git add -A && git commit -m "initial commit"
runway app deploy
Run runway app open to see it live, or check the Runway UI. Check runway app logs if something’s off.
Read on here, to learn how to enable custom extensions, e.g. to be able to use your PostgreSQL database on Runway from PHP!
If your app needs background work, or a step that runs before every deploy, see workers and init processes.