Soob
23 January 2023 21:41
1
Hi,
I have problem while upgrading from 8.2.1 to 8.2.2. When I use the command:
./bin/console suitecrm:app:upgrade -t SuiteCRM-8.2.2
I get an error:
PHP Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{’ or ‘$’ in /home/…/bin/console on line 17
I found my problem to be similar to SuiteCRM 7.12.x migration to SuiteCRM 8.x syntax error, unexpected 'class' (T_CLASS)
I checked following.
Line 17 looks like this:
if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
CLI PHP version is 8.0.21 (I tried 7.4 and 7.3 as well).
Is there anything else I can try/test? I would be grateful for any help.
As I understand this is the problem with PHP version. I got this response from GitHub developers.
Blockquote
according to the compatibility matrix 7.12.x is only supporting up to PHP8.0.
Versions SuiteCRM 7.14.x Platform
Linux, Unix, Mac OS
Any version supporting PHP
Windows
Windows Server 2019+
PHP
8.1, 8.2
Web Server
Apache
2.4
IIS
10
Database
MariaDB
10.4, 10.5, 10.6, 10.10, 10.11
MySQL
The roadmap is saying PHP8.2 support will be part of SuiteCRM-7.14 and 8.4.
Blockquote
But as I can see your server PHP version is ok?
I am personally waiting for PHP 8.2 to be supported in SuiteCRM.
Soob
24 January 2023 16:49
3
Yes, it looks like a version problem but my server PHP version seems to be fine.
What do you get with this command:
php -V /version/
Soob
24 January 2023 17:40
5
With PHP 8 version it’s:
PHP 8.0.21 (cli) (built: Jul 5 2022 09:25:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.21, Copyright (c) Zend Technologies
with Zend OPcache v8.0.21, Copyright (c), by Zend Technologies
pgr
25 January 2023 15:30
6
That is the CLI version, the web server can be different.
You can find out in Admin / Diagnostics / phpinfo
Soob
25 January 2023 19:58
7
Yes, it’s from CLI. Isn’t it the one that is important while running upgrade commands through CLI?
Server version is 7.4. It was 8.0 but I had to change it to 7.4 due to errors in email module.
pgr
26 January 2023 10:20
8
You are correct, my apologies for not reading the posts correctly.
You now changed to PHP 7.4? With 7.4, do you still get the same error as above?
Soob
26 January 2023 11:32
9
No problem.
I’ve changed server PHP version to 7.4. I’ve tried to upgrade through CLI with PHP versions 8.0, 7.4 and 7.3 - all resoulting with same error.
pgr
26 January 2023 11:41
10
Does your file match this one, character by character?
#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the ' . PHP_SAPI . ' SAPI' . PHP_EOL;
}
set_time_limit(0);
require dirname(__DIR__) . '/vendor/autoload.php';
if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
This file has been truncated. show original
As far as I can research, there are only two ways you can be seeing this error:
an old PHP version for some reason getting invoked
some syntactic problem a bit above the error line
EDIT: one more possibility!
some trouble inside the required file which precedes this line (require dirname(__DIR__) . '/vendor/autoload.php';
)
Soob
26 January 2023 11:59
11
Thank you. I’ll check that and will let you know about the results.
Soob
28 February 2023 11:58
12
I’m sorry for the late response.
The file matched character by character. It occurred as you wrote that old PHP version was involved. It was some error on hosting site. They gave me another solution and it worked.
Thank you all for your time and help
1 Like