Deploying PHP and Composer on Flightcontrol
Generally speaking, your PHP/Composer applications should deploy on Flightcontrol without any special configuration.
However, there are a few things you should be aware of before setting up your Flightcontrol project.
PHP Versions
Flightcontrol uses the Nixpacks PHP Provider to deploy your application. By default, Flightcontrol will use version 8.2 of PHP. The other two options are 8.1 and 8.0. Applications on PHP 7 or below will need to be upgraded, as these versions are past the end of their support life.
Nginx
Flightcontrol uses Nginx as the web server for your PHP web application.
You can provide your own nginx.conf
file, or you can provide your own nginx.template.conf
file, based on the syntax and structure of the Nixpacks PHP Provider Nginx Template
Deploying a PHP/Composer Project with Flightcontrol
If you need a Flightcontrol account, sign up at the Flightcontrol Dashboard.
You’ll also need to have your PHP application in a GitHub repository - either private or public.
After setting up your Flightcontrol account, start a new project and connect Flightcontrol’s GitHub app to your repository. For step-by-step instructions on this process, see our Connecting GitHub guide.
You will need to set up an environment within the project to hold your web service. This could be the “Production” environment, for instance.
Inside of that environment, you will need to add a “Web Server” service.
The Web Server defaults are fine for PHP/Composer builds. Flightcontrol will automatically detect that your project is a PHP project and will use the default build, start, and install commands from Nixpacks PHP Provider to deploy your application. If you need to customize these commands - for instance for a database migration or for running commands for your JavaScript assets, you can do this through the dashboard.
After you save and deploy the project, Flightcontrol will spin up an ECS instance, and make it available to you on a publicly available URL.
Adding Relational Databases or Redis
Flightcontrol supports MySQL, PostgreSQL, and MariaDB databases through AWS Relational Database Service (RDS). If you need Redis, Flightcontrol can also deploy a Redis instance for your project with AWS ElastiCache.
If you add a database or Redis instance to your project, Flightcontrol will automatically add the appropriate environment variables (DATABASE_URL
or REDIS_URL
) to your environment to connect to the database or Redis instance. You can also customize the environment variable names or get the connection strings directly if needed.
Next Steps
After you get the project successfully deployed, commit another change to the main
branch of your GitHub repository and see the changes build and deploy to your instance. After the initial provisioning process, subsequent commits will deploy much faster.
If you need help deploying your PHP/Composer application on Flightcontrol, reach out to us and we’ll be happy to help you get your project up and running with Flightcontrol.