A
A
Alexey Pustoutov2018-03-10 00:27:14
symfony
Alexey Pustoutov, 2018-03-10 00:27:14

How to set up Symfony 3.4 on linux mint so that everything works correctly?

The essence is this I
configure the Apache 2.4 server:
as suggested on the official website for my version. In general, with this configuration
https://symfony.com/doc/3.4/setup/web_server_confi...
I also tested the minimum configuration with an indication of the site root (not in the web folder)
In the first option, rewrite does not work - when going through routes - 404
Found the variant .htaccess
qaru.site/questions/124397/symfony2-rewrite-rules-...
it seems to be easier with it - but the addresses to the image in the web directory and when starting the built-in server start to differ.
%7B%7B%20asset('apple-touch-icon.png')%2- stops working on the local domain.
I ran a little ahead ...
I put on a symphony
composer create-project symfony/framework-standard-edition sym.aronix.ru I
create a new bundle with the symfony command, but it does not register in the composer's autoload.
I write it with pens - it starts to run - but !!! He writes that he cannot find the path to the twig template
. Then you need to somehow deploy all this economy to the server, I would not really want to go into the server apache config to specify the web root folder in the project.
How to bring all this into working condition and set up the correct deployment to the server?
Help me sort this out.
I really want to start working with symphony, but there is some kind of wall of problems. Please help me, I'm ready to pay money to help with the analysis of the situation and the clarification of the problem because of what such garbage is happening.
I watch videos on YouTube, they simply create everything and everything works for them, and I have a second week of rake. Silex is much easier. But I want Symphony.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Pustoutov, 2018-03-11
@alex3319

With the generation of the bundle, the problem remains, the same with autoload. Decided the rest.
I figured out how to work with the template:
In general, I figured it out. Thanks to one specialist.
An essence such - I generated the controller through bin/console
In general a problem in the generator. Version 3.4 has a curve.
It was

<?php

namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

class PostController extends Controller
{
    /**
     * @Route("/index")
     */
    public function indexAction()
    {
        return $this->render('AppBundle:Post:index.html.twig', array(
            // ...
        ));
    }

}

It became:
<?php

namespace AppBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

class PostController extends Controller
{
    /**
     * @Route("/index")
     */
    public function indexAction()
    {
        return $this->render('@App/Post/index.html.twig', array(
            // ...
        ));
    }

}

On error in twig template
Was:
{% extends "::base.html.twig" %}
Became:
{% extends "base.html.twig" %}
And it worked!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question