Deploy symfony 4.4 in shared hosting

Posted by

RUn the commands

Run the commands
      node_modules\.bin\encore production
      composer install –no-dev –optimize-autoloader
      composer dump-autoload –optimize –no-dev –classmap-authoritative

File Structure

  1. build paste from public/build
  2. bundles paste from public/bundles
  3. index.php
  4. .htaccess
  5. symfony
    1. config
    2. public
    3. src
    4. templates
    5. translations
    6. var  (empty content)
    7. vendor
    8. .env
    9. composer.json



<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        RedirectMatch 302 ^/$ /index.php/

Edit index.php

require __DIR__.’/symfony/config/bootstrap.php’;

Edit  config/services.yaml
   APP_ENV: “prod”
  env(DATABASE_URL): “mysql://user:pw@”

More details

Leave a Reply