You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using mautic/recommended-project to install Mautic 4 with Composer using a public-directory like docroot/ works well.
Doing the same for Mautic 5 fails, because the bootstrap is looking for a .env file inside the public direcotry docroot/, instead of the project-root where the mautic:install command creates it:
Fatal error: Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/var/www/html/docroot/app/../.env" environment file. in /var/www/html/vendor/symfony/dotenv/Dotenv.php:567 Stack trace: #0 /var/www/html/vendor/symfony/dotenv/Dotenv.php(114): Symfony\Component\Dotenv\Dotenv->doLoad(false, Array) #1 /var/www/html/docroot/app/config/bootstrap.php(17): Symfony\Component\Dotenv\Dotenv->loadEnv('/var/www/html/d...', NULL, 'prod') #2 /var/www/html/docroot/index.php(9): require('/var/www/html/d...') #3 {main} thrown in /var/www/html/vendor/symfony/dotenv/Dotenv.php on line 567
This is the generated folder structure (shortened):
/mautic-project
bin/
docroot/
app/
media/ // in local.php config we set 'upload_dir' => '%kernel.project_dir%/../media/files' etc...
plugins/
themes/
translations/
index.php
var/ // in local.php config we set 'cache_path' => '%kernel.project_dir%/../../var/cache' etc...
vendor/
.env // generated by mautic:install command
composer.json
How is it possible to configure the application to look inside the root for the .env file? Because it holds sensitive information, it is not recommend to have it inside the public directory.
Edit:
One sub-optimal workaround would be to patch the file docroot/app/config/bootstrap.php adding ../ to the path (using composer-patches):
(new Dotenv())->loadEnv(dirname(__DIR__).'/../../.env', null, 'prod');
The text was updated successfully, but these errors were encountered:
@Moongazer I just tried to reproduce this with the last release (5.0.2), and it works as expected
composer create-project mautic/recommended-project:^5.0 some-dir --no-interaction
<< output >>
cd some-dir
php ./bin/console mautic:install http://default <<all extra needed paramters>>
php ./bin/console mautic:install http://default
Mautic Install
==============
Parsing options and arguments...
0 - Checking installation requirements...
Missing optional settings:
- [0] It is recommended to secure your installation with an SSL certificate (https). Starting February 2020 Google Chrome will stop sending third-party cookies in cross-site requests unless the cookies are secure. Tracking will stop working for Mautic instances running on HTTP. Use HTTPS.
- [1] The <strong>memory_limit</strong> setting in your PHP configuration is lower than the suggested minimum limit of %min_memory_limit%. Mautic can have performance issues with large datasets without sufficient memory.
- [2] Configure <code>zend.assertions = -1</code> in php.ini for production environments for faster and more stable execution.
Ready to Install!
1 - Creating database...
1.1 - Creating schema...
1.2 - Loading fixtures...
2 - Creating admin user...
3 - Final steps...
================
Install complete
================
the contents of the config/local.php contains only the following keys:
Using
mautic/recommended-project
to install Mautic 4 with Composer using a public-directory likedocroot/
works well.Doing the same for Mautic 5 fails, because the bootstrap is looking for a
.env
file inside the public direcotrydocroot/
, instead of the project-root where themautic:install
command creates it:This is the generated folder structure (shortened):
How is it possible to configure the application to look inside the root for the
.env
file? Because it holds sensitive information, it is not recommend to have it inside the public directory.Edit:
One sub-optimal workaround would be to patch the file
docroot/app/config/bootstrap.php
adding../
to the path (using composer-patches):The text was updated successfully, but these errors were encountered: