tutorials questions & answers

CONFIGURE AND RUN SYMFONY (PHP) ON UBUNTU

TAGS:
  • php
  • symfony
  • framework
  • ubuntu
  • install
  • configrue
  • run

Prerequisites: - Web server (Apache2)

Step #1: Install composer by running: $ sudo apt install composer

Step #2: Create new symfony app example and save the app in (ex. /var/www/symfony):

$ cd /var/www/ $ sudo apt install php $ sudo apt install php-xml $ composer create-project symfony/skeleton symfony $ cd symfony $ composer require symfony/web-server-bundle --dev ^4.4.2 $ composer install

Step #3: Run the server by run: $ php bin/console server:run VPS.IP.ADDRESS:port

Output:

 [OK] Server listening on http://VPS.IP.ADDRESS:port

 // Quit the server with CONTROL-C.

PHP 7.2.24-0ubuntu0.19.04.2 Development Server started at ...
Listening on http://VPS.IP.ADDRESS:port
Document root is /var/www/symfony/public
Press Ctrl-C to quit.

Navigate to xxx.xxx.xxx:port url (where xxx.xxx.xxx is server ip, and where port is the selected port)

comments (0)

    Start now for as low as $2,99 a month!

    • 8 Characters2
    • 1 Uppercase Atleast
    • 1 Number Atleast
     
    Open livechat