symfony5

CPanel hosted Symfony website displays only HTML, fails to load the CSS and JS files

时光总嘲笑我的痴心妄想 提交于 2021-02-11 13:27:43
问题 We tried uploading a Symfony5 website on Cpanel, and the website is only displaying the HTML part however the CSS and JS doesn't seem to load . It says "net::ERR_ABORTED 404 (Not Found)" or "Failed to load resource: the server responded with a status of 404 (Not Found)" . We have two .htaccess files one, on the root of the project folder and another one inside the Public folder and the index.php on the public_html folder reads like below: Index.php : include dirname(__FILE__).'/

CPanel hosted Symfony website displays only HTML, fails to load the CSS and JS files

Deadly 提交于 2021-02-11 13:26:31
问题 We tried uploading a Symfony5 website on Cpanel, and the website is only displaying the HTML part however the CSS and JS doesn't seem to load . It says "net::ERR_ABORTED 404 (Not Found)" or "Failed to load resource: the server responded with a status of 404 (Not Found)" . We have two .htaccess files one, on the root of the project folder and another one inside the Public folder and the index.php on the public_html folder reads like below: Index.php : include dirname(__FILE__).'/

Symfony 5 and sudo commad using Windows 10

孤街醉人 提交于 2021-02-11 12:19:07
问题 I am following Fabien Potencier's book "Symfony 5: The Fast Track". I develop the project using Windows 10 pro 64 bit. The author of the book, however, works with Linux. In chapter 27 the following command should be executed, which works on Linux, but not on Windows 10: sudo API_ENDPOINT = 'symfony var: export SYMFONY_DEFAULT_ROUTE_URL --dir = ..' yarn encore dev I have installed Sudo for Windows, but the problem is not solved. How do I run this command on Windws 10? 来源: https://stackoverflow

Symfony can't find environment variable in the secrets

ぐ巨炮叔叔 提交于 2021-02-11 08:02:19
问题 I have the same problem as asked here. Followed Symfony Secrets Docu exactly as described. Generated the keys. Created the secret variable - php bin/console secrets:set APPLICATION_SECRET_KEY The variable is there with the right value - php bin/console secrets:list --reveal Added the following parameter to services.yaml parameters: myapp.application_secret_key: '%env(APPLICATION_SECRET_KEY)%' Trying to access the key from the controller by - $apiSecret = $this->getParameter('myapp.application

Symfony can't find environment variable in the secrets

给你一囗甜甜゛ 提交于 2021-02-11 08:02:00
问题 I have the same problem as asked here. Followed Symfony Secrets Docu exactly as described. Generated the keys. Created the secret variable - php bin/console secrets:set APPLICATION_SECRET_KEY The variable is there with the right value - php bin/console secrets:list --reveal Added the following parameter to services.yaml parameters: myapp.application_secret_key: '%env(APPLICATION_SECRET_KEY)%' Trying to access the key from the controller by - $apiSecret = $this->getParameter('myapp.application

Symfony 5 (Including 4) using Gedmo Doctrine Extension for SoftDelete

前提是你 提交于 2021-02-05 09:26:29
问题 I have tried to use soft delete (Using gedmo/doctrine-extensions) for some Entities in Symfony 5, and got some troubles: Listener "SoftDeleteableListener" was not added to the EventManager! Compile Error: App\Entity\Admin and Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity define the same property ($deletedAt) in the composition of App\Entity\Admin. However, the definition differs and is considered incompatible. Class was composed This is what I tried, and it runs well Install gedmo/doctrine

Uncaught Error: Class 'App\Kernel' not found

好久不见. 提交于 2021-01-29 16:34:57
问题 I'm currently facing an important issue when i want to run any "php bin/console" command: Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#29 #message: """ Attempted to load class "Kernel" from namespace "App".\n Did you forget a "use" statement for "Symfony\Component\HttpKernel\Kernel"? """ #code: 0 #file: "./bin/console" #line: 41 } 2020-06-11T15:43:20+00:00 [critical] Uncaught Error: Class 'App\Kernel' not found While my Kernel.php class is normally defined in src/Kernel.php I am

The class was not found in the chain configured namespaces

ε祈祈猫儿з 提交于 2021-01-29 12:51:44
问题 Hello, i need to explain what i'm was doing at first: I was on a project and for some reason I ended up having to use two databases instead of just one. so i do what it was needed to do, i change my doctrine.yaml settings with what is explain in the symfony doc and in that moment the error appeared An SQL error that says that it was no column found for X request on X table (the error is SQLSTATE[42S02], but it's not important) (in parallel of that error i need to say that the "--em" shit didn

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