Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    ParseError when installing

    Installing Bagisto
    2
    2
    267
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      crijken last edited by

      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......

      1 Reply Last reply Reply Quote 0
      • 0
        01aviral-webkul last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post