Andrew Fletcher published: 20 June 2023 1 minute read
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 Fletcher
•
27 Apr 2024
Streamlined Drupal 10 Deployment: Best Practices for Stability and Security
Have you ever walked into a situation at work and just wondered how everything still runs smoothly? I mean, there are deployments with so many fail-safes stacked on a shaky foundation that it's almost a miracle they work at all. The real trick is gently nudging the team toward accepting change to...
Andrew Fletcher
•
27 Apr 2024
TypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string
I'm getting the following errorTypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string in Drupal\views\Plugin\views\argument\ArgumentPluginBase->unpackArgumentValue() (line 1302 of...
Andrew Fletcher
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...