Khandaker Toihidul Islam
Software Engineer
Backend : PHP | Mysql | Symfony | CakePhp | Wordpress | Drupal
Frontend : Node js | Vue js | React Js | Javascript | HTML | CSS | Bootstrap
Tools , Server : Nginx | Apache | Git | Jenkins | Jira | Asana | Silenium | Spira

Deploy symfony 4.4 in shared hosting

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

 

.htaccess

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

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

Edit index.php

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

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

More details https://medium.com/@runawaycoin/deploying-symfony-4-application-to-shared-hosting-with-just-ftp-access-e65d2c5e0e3d

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *