ParseError when installing
-
I am an absolute Bagisto newbie, so be gentle

I have unzipped the source code to my host, edited the .env file with my database credentials and pointed my browser to the /public folder.
Then I get hit with a ParseError with seems unlogic to me:
syntax error, unexpected identifier "USER_ID", expecting "="In packages/Webkul/Installer/src/Helpers/DatabaseManager.php:18 it says:
const int USER_ID = 1;which looks like perfect syntax to me......
-
Hi,
Welcome to Bagisto!
The syntax itself is correct, but that declaration (const int USER_ID = 1;) uses typed class constants, which are only supported in PHP 8.3 and later.
This error usually means your server is running an older PHP version (such as 8.2, 8.1, or below), so PHP doesn't recognize the int type before the constant name and throws the parse error.
You can verify your PHP version by running:
php -v
or by checking the output of phpinfo() if you're using a web server.
If you're using a PHP version below 8.3, please upgrade to PHP 8.3, as the current Bagisto version requires it.
Thanks
Aviral
Team Bagisto