How to download symfony to get it on localhost?

0

I downloaded Symfony for the first time on my new computer. I created my first project in the Home folder. I am able to use it to create bundles but I can not get it on the localhost. How can you get it here?

It does not seem that I have the results expected by Muriado when he made his command:

:~$ php bin/console server:run
Could not open input file: bin/console

I used Ubuntu 16.04

    
asked by ThePassenger 14.02.2017 в 18:39
source

4 answers

1

You can run the following command in console:

php app/console server:run

For versions 2.8 and below

php bin/console server:run

For versions 3 onwards.

This will use the BUILT-IN php server, enabling (usually) the url localhost: 8000 with the development environment.

Another option is to configure an apache vhost (I see that it is your server) You can see how to do it in link , but in broad strokes, you need this:

<VirtualHost *:80>
    ServerName domain.tld
    ServerAlias www.domain.tld

    DocumentRoot /var/www/project/web
    <Directory /var/www/project/web>
        AllowOverride All
        Order Allow,Deny
        Allow from All
    </Directory>

    # uncomment the following lines if you install assets as symlinks
    # or run into problems when compiling LESS/Sass/CoffeeScript assets
    # <Directory /var/www/project>
    #     Options FollowSymlinks
    # </Directory>

    ErrorLog /var/log/apache2/project_error.log
    CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>

Where domain.tld is the domain that you will use to access (can be localhost or a domain redirected to your host) www.domain.tld is an alias of that domain (a secondary one, if you use it) and /var/www/project/web is the path to the web folder of your project in symfony.

    
answered by 15.02.2017 / 13:04
source
1

I recommend you better to use the command that is in the bin folder if it is the newer versions of symfony the command is

  

php console server: run

, Symfony configures a web server of tests ready to use in localhost: 8000.

    
answered by 21.02.2017 в 02:20
1

All you have to do is give permissions to the files that you just downloaded, go to the directory where you have the Symfony folder and execute the following:

sudo chmod -R 777 Symfony

With this you should be able to run the framework files from the browser

    
answered by 05.04.2017 в 16:27
-1

It's rare that you want me to run on localhost / symfony, it runs me directly on localhost; In any case, the folder of your symfony project should be placed inside your xamp environment or another one that you have installed, to achieve this you must follow the tutorial or another one that is clearer to you.

    
answered by 05.04.2017 в 03:40