In this article, I will demonstrate how you can install Symfony 4 on cloud hosting for PHP using Cloudways platform.
Continuing its emphasis on diversity, Symfony has recently published a major release which greatly improved the entire concept of standard Symfony application. This release provides a simple directory structure with less dependencies resulting in fast application development. The new release gives the feel of Silex in its structure.
The good news is that Flex is now included as a dependency in the new version. You can easily create a new Symfony 4 skeleton projects with Flex enabled. I’ve already discussed the directory structure and Flex.
Note: If you are running older versions and wish to upgrade to Symfony 4, follow the official upgrade guide
Let’s get started.
In my opinion, the best option for installing Symfony 4 on different cloud infrastructure providers including DigitalOcean, Linode, Vultr, AWS, is Cloudways. This platform offers the best managed experience.
First, launch a PHP server on cloud with Cloudways.
- Create your account by signing up for free on Cloudways platform.
- From the Application dropdown on your Cloudways dashboard, choose PHP Stack Custom from the list of available applications.
- Name your application and the server and select the project from the drop-down menu.
- Select the cloud provider from the list of available infrastructure providers.
- Select your desired server size .
- Select server bandwidth and storage size.
- Select the server location. This choice affects server latency so choose the location closest to your target audience in order to provide the best experience to the visitors.
- Click the Launch Server button to complete the setup.
Read More About: How to Host PHP Websites on AWS EC2 in One-Click
You can follow the GIF to launch the server on Cloudways
How to Install Symfony 4 Using Composer?
Now that the server is ready, move to Server Settings > Open SSH Terminal > move to the PHP app and run the following command to install Symfony 4:
composer create-project symfony/skeleton symfony4
This command will install the Flex enabled Symfony 4 application.
You might also like: Symfony Benchmarking with PHP 7.0 and 7.1
Now move to Application Access Detail page and open the app URL in a new browser tab. You will see the new Symfony 4 Welcome Page.
Yes, it is this easy to install Symfony 4 on a cloud provider using managed Cloudways servers.