Answer the question
In order to leave comments, you need to log in
symfony2. How to rename the web directory correctly?
Hello Dear Connoisseurs!
Please help me to solve the web directory problem. I made a mini site on symphony and decided to see the fruits of my creations on the hosting. Hosting is cheap, ssh is not, timeweb.
I renamed web folder to public_html
Then changed web to config.yml
assetic:
debug: "%kernel.debug%"
use_controller: "%kernel.debug%"
bundles: [ AllergoMainBundle ]
write_to: "%kernel.root_dir%/../public_html"
read_from: "%kernel.root_dir%/../../public_html"
...
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "public_html",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
[email protected]:/var/www/allergo.loc$ app/console server:run
The given document root directory "/var/www/allergo.loc/app/../web" does not exist
[email protected]:/var/www/allergo.loc$ app/console assetic:dump --env=dev --no-debug
Dumping all dev assets.
Debug mode is off.
14:47:40 [file+] /var/www/allergo.loc/app/../public_html/css/dfb0c29.css
[RuntimeException]
The source file "/var/www/allergo.loc/app/../../public_html/bundl
es/allergomain/css/main.css" does not exist.
Answer the question
In order to leave comments, you need to log in
Hosting is cheap, ssh is not
If the hoster supports symlink, then the easiest way is to link public_html to the web folder. It is not necessary to change the folder name.
Here it says symfony.com/doc/current/cookbook/configuration/ove...
Edit the app/config/config.yml file and specify the correct directory there.
# app/config/config.yml
# ...
assetic:
# ...
read_from: "%kernel.root_dir%/../../public_html"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question