0

I am trying to understand how this ClassLoader.php from Symfony works. Maybe someone could elaborate it once and for all so that we could quickly fix any such issues after site transfers.

The story is I am getting a lot of errors liek that:

Warning: include(/var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/wpml-string-translation/vendor/composer/../wpml-shared/wpml-lib-cache/src/cache/class-wpml-cache-directory.php): failed to open stream: No such file or directory in /var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/sitepress-multilingual-cms/vendor/composer/ClassLoader.php on line 444 

Warning: include(): Failed opening '/var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/wpml-string-translation/vendor/composer/../wpml-shared/wpml-lib-cache/src/cache/class-wpml-cache-directory.php' for inclusion (include_path='.:/php/includes:/usr/share/pear:/usr/libexec/php4-cgi/share/pear:/opt/alt/php55/usr/share/pear:/opt/alt/php54/usr/share/pear:/opt/alt/php53/usr/share/pear') in /var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/sitepress-multilingual-cms/vendor/composer/ClassLoader.php on line 444 

Warning: include(/var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/wpml-media-translation/vendor/composer/../wpml-shared/wpml-lib-cache/src/cache/class-wpml-cache-directory.php): failed to open stream: No such file or directory in /var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/sitepress-multilingual-cms/vendor/composer/ClassLoader.php on line 444 

Warning: include(): Failed opening '/var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/wpml-media-translation/vendor/composer/../wpml-shared/wpml-lib-cache/src/cache/class-wpml-cache-directory.php' for inclusion (include_path='.:/php/includes:/usr/share/pear:/usr/libexec/php4-cgi/share/pear:/opt/alt/php55/usr/share/pear:/opt/alt/php54/usr/share/pear:/opt/alt/php53/usr/share/pear') in /var/www/vhosts/73/258197/webspace/httpdocs/domain/public/wp-content/plugins/sitepress-multilingual-cms/vendor/composer/ClassLoader.php on line 444  

If I turn the problematic plugin off, the other one with ClassLoader.php comes up and gives the same errors.

So far I understood it's something to do with a loading of PHP classes and this ClassLoader.php for some reason keeps looking for a class that stored in a cache folder on my old server.

Why and how does it look for it? How does it know about classes from other plugins? Is it somehow stored in DB? And how can I fix that?

  • Hard to guess what is going on there from just errors, best start would probably be to contact authors of the plugin responsible. – Rarst May 30 '17 at 16:10
  • I doubt they can do anything. Since it's Symfony's component and the way autoloader works in PHP. I just dunno exactly how it works so that I could fix that... Pretty much doing reverse engineering in here – Alex Reds May 30 '17 at 16:14
  • They should at the very least be aware how they had implemented autoloader in their product and what might be possible causes for it to fail in that way. At least they have seen the code, we didn't. :) – Rarst May 30 '17 at 16:16
  • Well, I can try... it certainly won't hurt. It's just so time-consuming. Not to mention I saw similar posts on WPML forums and all authors suggested is to disable and enable their plugin. It didn't help in my case. – Alex Reds May 30 '17 at 16:26

Your Answer

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

Browse other questions tagged or ask your own question.