I'm using symfony4. Everything works in dev. But there is less tutorial for prod. How to deploy tutorial provides only less info (No info about shared hosting)
Index.php prevents .env from reading the environment variables. Thats fine. But in Symfony2.x we can switch between env by app.php and app_dev.php front controllers. But in Symfony4 There is no such files only one index.php and an .env file
According to the deploy link .
How you set environment variables, depends on your setup: they can be set at the command line, in your Nginx configuration, or via other methods provided by your hosting service.
I'm using shared hosting, so the provider does not allow to change environment variables. If it is in my file, I can use it good.
Currently to overcome this problem, what i'm doing is,
$_SERVER['APP_ENV'] = "prod";
$_SERVER['APP_SECRET'] = "79cfa09223f91b1a195134019e0b17ac";
I added these two line at the beginning of index.php and bin/console file. I think this is not the correct way to do.
Suggest me hot to deploy symfony4 (Even testing prod environment)