Error whnen install 11.2 "syntax error, unexpected identifier "RECIPE_PACKAGE_TYPE",

Created on 17 July 2025, 3 months ago

Can't install Drupal11.2, getting error message
Installing drupal/core-recipe-unpack (11.2.2): Extracting archive
Install of drupal/core-recipe-unpack failed
In Plugin.php line 28:
[ParseError]
syntax error, unexpected identifier "RECIPE_PACKAGE_TYPE", expecting "="
I got this same error message when I perform "composer create-project drupal/recommended-project:11.2.2 "public_html" and "composer install" , I endup getting a empty "web" folder and a "vendor" folder only. my php version is 8.4 (edited)

๐Ÿ› Bug report
Status

Active

Version

11.2 ๐Ÿ”ฅ

Component

install system

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom freelylw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @freelylw
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu raj Noida

    I tested installing Drupal 11.2.2 with PHP 8.3 on my local setup using DDEV, and the installation completed without any errors.

    The web and vendor folders were created properly.
    Could you please confirm if you have tried the installation using PHP 8.3 as well?
    Also, are you using DDEV or some other local environment like XAMPP, Docker, etc.?

    Sharing these details could help us better understand the issue and possibly isolate the cause.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom freelylw

    I just tried on Php8.3, exactly the same problem and error message . I am installing on a clean fresh VPS hosting account, no DDEV XAMPP or anything else.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu raj Noida

    Thanks for confirming.
    Since the issue persists on PHP 8.3 in your VPS environment, it likely relates to your serverโ€™s PHP build, extensions, or configuration.
    Please share your exact PHP version output (php -v), enabled extensions (php -m), and OS details. Checking OPcache settings or clearing Composer cache (composer clear-cache) might also help.

  • By the error it could be that the PHP version is not actually 8.4.

  • First commit to issue fork.
  • ๐Ÿ‡ช๐Ÿ‡ธSpain TornatoreMDM

    To provide more information, I received the same error when trying to do a clean install with DDEV on PHP version 8.2.22 and Composer 2.7.7.
    Upgrading to PHP version 8.3 and attempting the installation with DDEV again worked correctly.

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinaysamant Kudal, Maharashtra

    i m trying to install D11 since 11.1. Facing many issues. So i have to install D10.5. I use composer also and direct download also. Both not working for D11.

    I am getting following errors -
    - Installing composer/installers (v2.3.0): Extracting archive
    - Installing drupal/core-composer-scaffold (11.2.2): Extracting archive
    - Installing drupal/core-project-message (11.2.2): Extracting archive
    - Installing drupal/core-recipe-unpack (11.2.2): Extracting archive
    Install of drupal/core-recipe-unpack failed

    In Plugin.php line 28:

    [ParseError]
    syntax error, unexpected identifier "RECIPE_PACKAGE_TYPE", expecting "="

    Exception trace:
    at /var/www/clients/client2/web29/web/drupal11/vendor/drupal/core-recipe-unpack/Plugin.php:28
    Composer\Autoload\{closure}() at phar:///usr/local/bin/composer/vendor/composer/ClassLoader.php:427
    Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
    class_exists() at phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php:293
    ...

    Steps to reproduce
    I have dedicated server installed at OVH.
    It's Debian Bookworm with ISP 3.2 & Apache 2
    PHP 8.2.29 & 10.11.11-MariaDB
    commad is used : composer create-project drupal/recommended-project:11.2.2 ./

    Proposed resolution
    syntax error, unexpected identifier "RECIPE_PACKAGE_TYPE", expecting "="
    this needs to be corrected.

  • Yes, it looks like the PHP version is old. What does php -v show?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    PHP 8.2.29 & 10.11.11-MariaDB
    commad is used : composer create-project drupal/recommended-project:11.2.2 ./

    Drupal 11 requires PHP 8.3: https://www.drupal.org/docs/getting-started/system-requirements/overview... โ†’

    I wonder if there is something we should add to drupal/recommended-project or another dependency to prevent Composer from trying to install on an earlier version.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Can reproduce locally:

    $ php8.2 /usr/local/bin/composer create-project drupal/recommended-project:11.2.2
    Creating a "drupal/recommended-project:11.2.2" project at "./recommended-project"
    Installing drupal/recommended-project (11.2.2)
      - Downloading drupal/recommended-project (11.2.2)
      - Installing drupal/recommended-project (11.2.2): Extracting archive
    Created project in /tmp/recommended-project
    Installing dependencies from lock file (including require-dev)
    Verifying lock file contents can be installed on current platform.
    Package operations: 64 installs, 0 updates, 0 removals
    ...
      - Installing composer/installers (v2.3.0): Extracting archive
      - Installing drupal/core-composer-scaffold (11.2.2): Extracting archive
      - Installing drupal/core-project-message (11.2.2): Extracting archive
      - Installing drupal/core-recipe-unpack (11.2.2): Extracting archive
        Install of drupal/core-recipe-unpack failed
    
    In Plugin.php line 28:
                                                                                
      [ParseError]                                                              
      syntax error, unexpected identifier "RECIPE_PACKAGE_TYPE", expecting "="  
                                                                                
    
    Exception trace:
      at /tmp/recommended-project/vendor/drupal/core-recipe-unpack/Plugin.php:28
    
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Let's try to find a way to prevent this by adding a constraint somewhere, so Composer gives a more useful error message.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Discussed with @catch. drupal/core also specifies a minimum PHP version, but composer create-project must ignore this. We discussed adding it to the drupal/core-recommended metapackage but probably the most reliable option is to add it to the project template, which is what Symfony and Laravel also do.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinaysamant Kudal, Maharashtra

    i m sorry for trying this with php-8.2. i will upgrade php on my server to 8.3 n retry this. But i with if composer or drupal installer can clearly show a message that this will not install on 8.2 .. will be more helpful.

Production build 0.71.5 2024