What is Symfony
Symfony is very popular PHP-based framework. It is often use for web-applications development. Main advantages of this environment is open-source code, large users community and actual documentation.
Before setup
To install Symfony you need a server meeting the following requirements:
- Server with at least 2Gb RAM and 20Gb disk space;
- Actual operation system (Ubuntu 20.04 as this article example);
- Privileged user acess;
- Web-server, PHP 7.0 or newer, database server installed.
The fastest way to prepare server to main product installation is install any web-panel, e.g. HestiaCP. When panel is ready, do these steps:
- Check current PHP version. You may do it via panel or run simple command in the SSH-console;
php -v
- Open the SSH-session and install required php-extension:
apt-get install -y php<your_version>-sqlite3
- Login to the panel and create "simple", non-administrative user. Click to Users > Add user, fill the required info and then Save button;
- Login as created user;
- Create web-domain via panel;
- Install composer in the website location:
cd /tmp
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/bin --filename=composer
- Install the tool to make final check:
apt install -y curl
curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | sudo -E bash
apt install -y symfony-cli
- Run the checking procedure:
symfony check:requirements
As you see, configuration is OK, preparing is finished, go to the next step.
Framework installation
It is very simple. To make your own demo-project just run:
su <non-privileged account>
composer create-project symfony/website-skeleton myproject
Now you can open URL http://<your_domain>/<your_appname>/public. If you see page as below - setup finished, take a coffee-break.
Conclusion
In this article we're discribed what is Symfony Framework and how to install it to your Ubuntu 20.04 server