Composer and Symfony errors prevent install page from loading

Hi everyone,

After being unable to install Suite CRM 7.12, I am now trying to install SuiteCRM 8.1.2 from the official site. My server has Plesk Obsidian v18.0.45 running over Ubuntu 20.04.4 LTS, with Apache version 2.4.41 and PHP version 8.0.21.

I have followed step by step the official installation guide for v8, as well as read and tried some tips given in this and other forums. So this is what I have done:

  1. Uncompressed the zip file in my computer and then uploaded all files via ftp, as some people reported issues when uncompressing directly in the server.

  2. Created a subdomain crm.mydomain.com and pointed it to /suitecrm/public/

  3. Updated the system and installed PHP 8.0-FPM from Ubuntu at the ondrej/php repository, in order to be able to try workarounds with Plesk’s 7.4, Plesk’s 8.0.21 and the ‘official’ 8.0-FPM versions of PHP, even though the errors I get reproduce with all of them.

  4. Chose initially the ‘official’ 8.0-FPM version of PHP. Listed all modules and couldn’t see ‘cli’ nor ‘common’ on the list, so installed them. After installing them, listed all modules and still could not see them.

  5. Enabled mod_rewrite in Apache in 2 ways: first with the ‘sudo a2enmod rewrite’ command (answered that it was already enabled) and, just in case, adding the ‘RewriteEngine on’ to the ‘http and https additional directives’ sections in the Apache settings tab of Plesk for the crm subdomain.

  6. Also added the directives ‘Options Indexes FollowSymLinks’, ‘AllowOverride All’ and ‘Require all granted’ to the /suitecrm/public folder using the Directory tag in the /etc/apache2/apache2.conf file using sudo nano.

  7. In Plesk’s PHP settings for this crm subdomain, added the [opcache] directives.

  8. I made sure that the username and group of Apache are both www-data. Once confirmed, I executed the following as suggested:

find . -type d -not -perm 2755 -exec chmod 2755 {} ;
find . -type f -not -perm 0644 -exec chmod 0644 {} ;
find . ! -user www-data -exec chown www-data:www-data {} ;
chmod +x bin/console

After this, I tried to open the install page and got 3 errors. As per what they say, they look to be 2 errors related to Composer and 1 error related to Symfony (but I don’t have the knowledge nor the experience to interprete them):

Warning: include(/var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/composer/…/…/core/backend/Currency/LegacyHandler/CurrencyHandler.php): Failed to open stream: No such file or directory in /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening ‘/var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/composer/…/…/core/backend/Currency/LegacyHandler/CurrencyHandler.php’ for inclusion (include_path=’.:/usr/share/php’) in /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/composer/ClassLoader.php on line 444

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service “App\FieldDefinitions\LegacyHandler\CurrencyDropdownFunctionDefinitionMapper”: argument “$currencyHandler” of method “__construct()” has type “App\Currency\LegacyHandler\CurrencyHandler” but this class was not found. in /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php on line 54

When I execute ‘groups www-data’ I get ‘www-data : www-data psaserv’ and this made me think that perhaps the www-data user belongs to 2 different groups (www-data and psaserv) so I tried, as suggested in the v8 guide, to give ‘0664’ instead of ‘0644’, and ‘2775’ instead of ‘2755’ - but nothing happened. Probably because the provided commands will not work consecutively.

Since I didn’t know how to use the same command syntax to undo the first find chmod changes, I just tested using the commands suggested in the guide for v7, which are simpler ( sudo chown -R ) and tested giving different number combinations for different permissions following a guide that explains them. I then got errors saying that the page was unable to write to the cache or the logs folders, so in order to discard writing issues I just gave the 777 permissions to ALL of the folders and files inside the /suitecrm/ folder.

But then the same Composer and Symfony errors appear again. They appear independently to whatever user owns the /suitecrm/ folder and its contents, and when all users in all groups as well as others have permissions to write. I do believe it might not be an issue with permissions? And no, I don’t have SELinux installed, there is just an SELinux folder with a semanage.config file but in it there is no SELinux line where to add the ‘disabled’.

Can anyone PLEASE suggest what else I can try? @pgr @clemente.raposo .

Cheers,

Javier

Hi again,

I have tried many permission combinations splitting the command into files and directories, as per @pgr’s suggestion. I gave all folders permission code 0644 and files 2755. But the installation page showed up an error saying that the cache and logs directories were unwritable. So I gave permissions 2777 to these 2 directories and to the files in them.

I am still getting the same Symfony error:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service “App\FieldDefinitions\LegacyHandler\CurrencyDropdownFunctionDefinitionMapper”: argument “$currencyHandler” of method “__construct()” has type “App\Currency\LegacyHandler\CurrencyHandler” but this class was not found. in /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php:54 Stack trace: #0 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(81): Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue()

#1 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php(32): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()

#2 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php(46): Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass->processValue()

#3 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/Compiler.php(91): Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process()

#4 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/ContainerBuilder.php(731): Symfony\Component\DependencyInjection\Compiler\Compiler->compile()

#5 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/http-kernel/Kernel.php(541): Symfony\Component\DependencyInjection\ContainerBuilder->compile() #6 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/core/backend/Kernel.php(124): Symfony\Component\HttpKernel\Kernel->initializeContainer()

#7 /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/public/index.php(34): App\Kernel->getLegacyRoute() #8 {main} thrown in /var/www/vhosts/plesk-subscription-name/httpdocs/website-folder/suitecrm/vendor/symfony/dependency-injection/Compiler/DefinitionErrorExceptionPass.php on line 54

I have tried to install SuiteCRM using terminal:

./bin/console suitecrm:app:install

And I am getting this error:

In DefinitionErrorExceptionPass.php line 54:

Cannot autowire service “App\FieldDefinitions\LegacyHandler\CurrencyDropdownFunctionDefinitionMapper”: argument “$currencyHandler” of method “__construct()” has type “App
\Currency\LegacyHandler\CurrencyHandler” but this class was not found.

I am desperate. Don’t know what else to do… Any ideas?

Cheers,

Javier

I don’t know.

Remember that errors while executing composer can cause dependencies to be broken, and this will manifest later in random execution errors like these that you are seeing.

Anyway, if you use the installer package, it includes the full vendor directory as needed. So you can just use that and it should work without executing composer.

1 Like

Hi @pgr,

I just updated composer because I thought that the usual installation via install page or terminal, needed composer to be working. Actually, if you read my post carefully (I know it is long, sorry about that), by updating composer I was able to bypass two errors that appeared. But this last Symfony error won’t go.

I was suggested at the Plesk forum to use Installatron, I will give it a try and come back with the outcome.

Cheers,

Javier

Dear @pgr, @clemente.raposo ,

I was checking the Installatron website and realised that they partnered with IONOS and Amazon Web Services to provide a one-click installation solution for their cloud servers. Since what I had until now with IONOS was a VPS and these do not have this feature, I got today a Cloud server with IONOS, to then discover that if you install SuiteCRM, the process will delete any previous installation (OS + Plesk). So, what I have done, instead, is to install Debian 11 + Plesk on this Cloud server and try to install SuiteCRM manually on it. I installed Debian 11 instead of Ubuntu just because IONOS stated that their one-click SuiteCRM installation would only run on Debian 11.

I followed all the steps in the official installation guide for SuiteCRM v8. I was able to solve an issue with the upload_max_filesize by searching for absolutely all php.ini files and setting this value to 100M. And when I was almost sure that the installation would finish, now I get the following error at the run_legacy_install step:

CRITICAL [console] Error thrown while running command “suitecrm:app:install”. Message: “Call to undefined function opcache_get_status()” [“exception” => Error { …},“command” => “suitecrm:app:install”,“message” => “Call to undefined function opcache_get_status()”]

In SugarCache.php line 168:

Attempted to call function “opcache_get_status” from the global namespace.

And it locks the installation (but I learned that I can unlock it by setting the lock to false in the config.php file in /public/legacy/.

Need to say that I tried both adding and not adding the following to the php.ini file, as suggested in the installation guide (where it says it is optional):

[opcache]
; Determines if Zend OPCache is enabled
zend_extension=opcache.so
opcache.enable=1

; The OPcache shared memory storage size.
opcache.memory_consumption=256

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=20000

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=0

Any suggestions to solve this opcache error?

Cheers,

Javier

Make sure you have the module installed, something equivalent to

apt-get install php-opcache

but do a little googling first, these commands tend to vary by OS / PHP version.

1 Like

Hi Javier

did you solve this problem with the suggested installation? There are other people here in the forums having the same problem