Skip to main content

Whilst attempting to download the latest config.zip file for Solr, I was greeted by the following error:

Error: Class "MyCLabs\Enum\Enum" not found in include() (line 18 of /var/www/vhosts/{domain.com}/vendor/maennchen/zipstream-php/src/Option/Method.php)
#0 /var/www/vhosts/{domain.com}/vendor/composer/ClassLoader.php(582): include()
#1 /var/www/vhosts/{domain.com}/vendor/composer/ClassLoader.php(433): Composer\Autoload\{closure}()
#2 /var/www/vhosts/{domain.com}/vendor/maennchen/zipstream-php/src/Option/Archive.php(131): Composer\Autoload\ClassLoader->loadClass()
#3 /var/www/vhosts/{domain.com}/modules/contrib/search_api_solr/src/Controller/SolrConfigSetController.php(462): ZipStream\Option\Archive->__construct()
#4 [internal function]: Drupal\search_api_solr\Controller\SolrConfigSetController->streamConfigZip()
#5 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#6 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#7 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#8 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#9 /var/www/vhosts/{domain.com}/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /var/www/vhosts/{domain.com}/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#11 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#12 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#13 /var/www/vhosts/{domain.com}/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#14 /var/www/vhosts/{domain.com}/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#15 /var/www/vhosts/{domain.com}/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#16 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#17 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#18 /var/www/vhosts/{domain.com}/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#19 /var/www/vhosts/{domain.com}/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#20 /var/www/vhosts/{domain.com}/index.php(19): Drupal\Core\DrupalKernel->handle()
#21 {main}

 

Reading through the notes on the Enum Github page and I read the following key line

"First, and mainly, SplEnum is not integrated to PHP, you have to install the extension separately."

Installation is to run the following composer command:

composer require myclabs/php-enum

But first I want to validate if Enum exists on the environment.  A quick read of enum_exists and testing is via adding code.

Related articles

Andrew Fletcher11 Feb 2025
Webpack build process and theme automation improvements
The Drupal theme configuration has undergone recent changes made to the Webpack configuration, SCSS and JavaScript handling, and automation of updates to the orw.libraries.yml file in the custom Drupal theme. These changes are designed to improve the build process, enhance maintainability, and...
Andrew Fletcher22 Jan 2025
Removing a missing module in Drupal
Occasionally, a Drupal site may display a warning about a module being "Missing or invalid." This issue occurs when a module is marked as installed in the configuration but is no longer present in the file system. A common example is the `fakeobjects` module, which is associated with CKEditor 4 and...