Drush fails with php8 due to padraic/humbug_get_contents requirements

I’m sure there is a simple fix, but I can’t figure it out. This is my error every time I try to run drush updatedb

$ drush updatedb

Box Requirements Checker
========================

> Using PHP 8.0.9
> PHP is using the following php.ini file:
  /etc/php/php.ini

> Checking Box requirements:
  ..E.........

                                                                                
 [ERROR] Your system is not ready to run the application.                       
                                                                                

Fix the following mandatory requirements:
=========================================

 * The package "padraic/humbug_get_contents" requires the version "^5.3 || ^7.0
   || ^7.1 || ^7.2" or greater.

So far, the only way I have been able to bypass this is by forcing drupal/drush to use php7.4, but that doesn’t seem like it’s a good long-term solution.

If I could figure out where the requirement for padraic/humbug_get_contents comes from, I would try to modify it to add || ^8.0 or something like that, but I can’t determine which package requires that package using composer show --tree or composer depends padraichumbug_get_contents

I can’t seem to find other people having the same issue despite searching. It may also be worth noting that the issue occurs across multiple sites on the same machine, so it is not likely to be some kind of mis-configuration of that site or installation. Other commands work fine on the install, as does running update.php through the web browser, it seems like it’s just drush that doesn’t work.

Does anyone have any suggestions that I may be able to use to solve this issue without rolling back to a previous version of php?

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Drush fails with php8 due to padraic/humbug_get_contents requirements

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.