1
1
1alexandr2015-01-23 02:03:12
symfony
1alexandr, 2015-01-23 02:03:12

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"
...

Then changed in composer.json
"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"
        }
    }

Did
app/console cache:clear --env=prod
app/console cache:clear --env=dev
app/console assets:install public_html --symlink
app/console assetic:dump --env=prod --no-debug
app /console assetic:dump --env=dev --no-debug
Last 2 commands failed, tell me what I'm doing wrong please!
[email protected]:/var/www/allergo.loc$ app/console server:run
The given document root directory "/var/www/allergo.loc/app/../web" does not exist

here's another exhaust
[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

3 answer(s)
S
Sergey, 2015-01-23
Protko @Fesor

Hosting is cheap, ssh is not

timeweb.com/en/support/faq/hosting/technical/288
Returning to the question, how exactly did you fail? Post the log or at least the error.

J
jaxel, 2015-01-23
@jaxel

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.

D
Dmitry Koldyaev, 2015-01-23
@dkoldyaev

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"

In general, of course, it is easier to make a symlink.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question