symfony

Docker - nginx: host not found in upstream

我们两清 提交于 2021-01-27 05:36:23
问题 I download official docker packages, and then I set docker-compose. Everything compiles OK, but if I get docker-compose up , I got this error message: project-websrv | 2017/09/22 10:18:35 [emerg] 1#1: host not found in upstream "php-fpm" in /etc/nginx/conf.d/default.conf:25 project-websrv | nginx: [emerg] host not found in upstream "php-fpm" in /etc/nginx/conf.d/default.conf:25 project-php exited with code 0 nginx.conf line 25: fastcgi_pass php-fpm:9000; my docker-compose.yml version: "3.1"

Docker - nginx: host not found in upstream

纵然是瞬间 提交于 2021-01-27 05:35:22
问题 I download official docker packages, and then I set docker-compose. Everything compiles OK, but if I get docker-compose up , I got this error message: project-websrv | 2017/09/22 10:18:35 [emerg] 1#1: host not found in upstream "php-fpm" in /etc/nginx/conf.d/default.conf:25 project-websrv | nginx: [emerg] host not found in upstream "php-fpm" in /etc/nginx/conf.d/default.conf:25 project-php exited with code 0 nginx.conf line 25: fastcgi_pass php-fpm:9000; my docker-compose.yml version: "3.1"

How to fix “This repository can be attached only to ORM sortable listener” error in Gedmo sortable?

空扰寡人 提交于 2021-01-27 05:24:17
问题 When usieing StofDoctrineExtensions (which is a Symfony2 port of Gedmo Doctrine Extensions) Sortable behaviour I kept on getting this error: This repository can be attached only to ORM sortable listener Since I could not easily find the answer in official docs I'm leaving an answer here for future reference. 回答1: You need to enable any listeners you are using. In this case, Sortable. stof_doctrine_extensions: default_locale: en_US orm: default: sortable: true For Symfony 4, add this

How to fix “This repository can be attached only to ORM sortable listener” error in Gedmo sortable?

一个人想着一个人 提交于 2021-01-27 05:23:31
问题 When usieing StofDoctrineExtensions (which is a Symfony2 port of Gedmo Doctrine Extensions) Sortable behaviour I kept on getting this error: This repository can be attached only to ORM sortable listener Since I could not easily find the answer in official docs I'm leaving an answer here for future reference. 回答1: You need to enable any listeners you are using. In this case, Sortable. stof_doctrine_extensions: default_locale: en_US orm: default: sortable: true For Symfony 4, add this

How to inject Doctrine Entity Manager into Symfony 4 Service

泄露秘密 提交于 2021-01-27 05:15:07
问题 I have a controller use Doctrine\ORM\EntityManagerInterface: class ExampleController{ public function someFunction(ExampleService $injectedService){ $injectedService->serviceFunction(); } } With a Service use Doctrine\ORM\EntityManagerInterface; class ExampleService{ public function __construct(EntityManagerInterface $em){ ... } } However, calls to someFunction() fail due to 0 parameters being passed (the EntityManagerInterface is not being injected). I am attempting to use the EntityManager

How to inject Doctrine Entity Manager into Symfony 4 Service

时光总嘲笑我的痴心妄想 提交于 2021-01-27 05:15:07
问题 I have a controller use Doctrine\ORM\EntityManagerInterface: class ExampleController{ public function someFunction(ExampleService $injectedService){ $injectedService->serviceFunction(); } } With a Service use Doctrine\ORM\EntityManagerInterface; class ExampleService{ public function __construct(EntityManagerInterface $em){ ... } } However, calls to someFunction() fail due to 0 parameters being passed (the EntityManagerInterface is not being injected). I am attempting to use the EntityManager

VichUploaderBundle - namer: Parent definition does not exist

不羁的心 提交于 2021-01-27 04:42:18
问题 config.yml vich_uploader: db_driver: orm mappings: media_image: uri_prefix: '%uploads_dir%' upload_destination: '%kernel.root_dir%/../web/uploads/images' namer: Vich\UploaderBundle\Naming\OrignameNamer Entity: /** * Media * @Vich\Uploadable * @ORM\Table(name="medias") * @ORM\Entity(repositoryClass="AppBundle\Repository\MediaRepository") */ class Media { use TimestampableEntity; /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */

Adding services to a Controller through “container.service_subscriber” not working as expected

社会主义新天地 提交于 2021-01-26 02:07:50
问题 I am trying to use the container.service_subscriber tag on my Controller to make some services available without injecting them through the constructor. In our project we don't want to use the autowiring and also can't use the autoconfigure option. The structure of the Controller is as follow: I have a base BaseController which extends from the AbstractFOSRestController of FOSRestBundle which has some common used methods for all my Controllers. That service will be used as parent for my other

How to use Vich uploader with easyAdmin 3 on Symfony 5

守給你的承諾、 提交于 2021-01-21 08:36:52
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

How to use Vich uploader with easyAdmin 3 on Symfony 5

孤人 提交于 2021-01-21 08:35:32
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation