Getting PHP Fatal error while doing initial CLI install on fresh VM

Hey all, so hereā€™s my situation:

Fresh VM in Proxmox, Debian 12, upgraded to the latest packages.

  • Installed PHP, MariaDB and Apache2
  • Installed all required PHP modules
  • Configured php.ini as described in the docs (in /etc/php/8.2/cli/php.ini, and then again in /etc/php/8.2/fpm/php.ini because the linked Symfony setup tutorial specified using FPM).
  • Configured the vhost like specified in the official docs, and added the redirect lines found in the linked Symfony docs that specify to use FPM.
  • Downloaded, unzipped and moved the ā€˜suitecrmā€™ folder to /var/www, and applied the required permissions.

Finally, I tried to simply connect to my IP address, but I had a white page.
With the CLI installer, I get the following output:

root@crm:/var/www/suitecrm# ./bin/console suitecrm:app:install
Cannot load Zend OPcache - it was already loaded
PHP Fatal error:  Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/var/www/suitecrm/.env" environment file. in /var/www/suitecrm/vendor/symfony/dotenv/Dotenv.php:553
Stack trace:
#0 /var/www/suitecrm/vendor/symfony/dotenv/Dotenv.php(106): Symfony\Component\Dotenv\Dotenv->doLoad()
#1 /var/www/suitecrm/config/bootstrap.php(47): Symfony\Component\Dotenv\Dotenv->loadEnv()
#2 /var/www/suitecrm/bin/console(30): require('...')
#3 {main}
  thrown in /var/www/suitecrm/vendor/symfony/dotenv/Dotenv.php on line 553

Iā€™m using PHP 8.2 with SuiteCRM 8.7.1, which should be compatible.

I can provide more info if needed, thanks for your inputs, cheers

Check your active PHP version in the VM.

php --version

or

php -v

Give this permission to your .env file

chmod 644 /var/www/suitecrm/.env


Clear symfony cache

From your instance root folder run:

bin/console cache:clear

1 Like

Thanks, here is php -v:

Cannot load Zend OPcache - it was already loaded
PHP 8.2.24 (cli) (built: Sep 27 2024 04:16:10) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.24, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.24, Copyright (c), by Zend Technologies

There is no ā€œ*.envā€ file in suitecrm/ folder, and ./bin/console cache:clear gives back the same error about the ā€œ.envā€ file.

Itā€™s strange you donā€™ thave the .env.

Which files do you have in the main folder?

1 Like

If youā€™re doing new installation of SuiteCRM.

Please download again from here and install it.


1 Like

Ah ! I had manged to screw the unzip (had unzipped without creating a subfolder and had manually moved files to my target folder afterwardsā€¦ thus hidden files starting with a ā€œ.ā€ were left behindā€¦ :face_with_peeking_eye:).

You can think youā€™ve done these things 100 times and still mess up !! :laughing:

Thanks for your time @pgr @rsp

1 Like