1

I have been using composer to install all Drupal modules, when I realized that they had not been installing to modules/contrib. So, I added this into my composer file:

"installer-paths": {
  "modules/contrib/{$name}": ["type:drupal-module"]
}

Then, I moved all modules to /contrib under the modules directory, and rebuilt my cache with drush cr. No errors.

Now I cannot reload the site, I am getting fatal errors about missing modules at their old paths.

How do I clear the autoloader so it gets updated to look in modules/contrib instead of just modules for class files?

Attached picture of the error.enter image description here

I tried removing the composer.lock file and running composer update - no dice.

Update

Looks like I did everything right, I just needed to reboot the VM to clear the APC cache.

Is there a way I could do that from command line instead of reboot the server?

1

I am using this to refresh module paths. I tried all other combos with apc_clear_cache etc and didnt help, also nginx restart didnt help, this 2 did.

service php7.2-fpm restart 
drush cr
  • It may help to explain a bit about why this would help answer the question rather than write out some commands. For instance, I think that restarting php-fpm will clear any opcache, but that may not necessarily be the case on all systems, and doing a cache-refresh in Drupal will force the Symfony/Drupal service container to be rebuilt. – mradcliffe May 3 at 12:02
  • 1
    I added a bit more context. I tried it all many times, testing for hours and only this combo worked every time. – Marko Blazekovic May 3 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.