rebuild.php cannot be run from Drupal root directory

Created on 20 January 2018, over 7 years ago
Updated 13 February 2023, over 2 years ago

Problem/Motivation

Running php core/rebuild.php from the Drupal root directory currently fails with:

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service file "core/core.services.yml" is not valid.

this is because the first line of the script changes directory:

// Change the directory to the Drupal root.
chdir('..');

assuming the script is being run from the core directory.

Proposed resolution

Add the __DIR__ magic constant to the chdir() call.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

9.5

Component
CacheΒ  β†’

Last updated 12 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States jhedstrom Portland, OR

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    Did not test.

    But moving to NW for the issue summary requested in #4. Also imagine this will need a test case to show the issue.

Production build 0.71.5 2024