7

I have followed several articles on this, but none solve my problem. Every request on site writes the following entry to the system log.

var/log/system.log:

2013-10-09T12:53:50+00:00 ERR (3): Warning: include(File.php): failed to open stream: No such file or directory  in /var/public_html/domain.com/live/lib/Varien/Autoload.php on line 93
2013-10-09T12:53:50+00:00 ERR (3): Warning: include(): Failed opening 'File.php' for inclusion (include_path='/var/public_html/domain.com/live/app/code/local:/var/public_html/domain.com/live/app/code/community:/var/public_html/domain.com/live/app/code/core:/var/public_html/domain.com/live/lib:.:/usr/share/pear:/usr/share/php')  in /var/public_html/domain.com/live/lib/Varien/Autoload.php on line 93

I have seen and followed articles that indicate this is related to the compiler.

What I've Done So Far

I have commented the two lines out in includes/config.php.

Cleared the profiler from terminal following Mr Storm's article: Magento Compiler.

Ensured that the caches are emptied and indexing has been run several times.

Compared a vanilla copy of 1.7.0.2 CE and looked for any files that my own codebase might be missing (using WinMerge).

Disabled symlinks in admin.

Changed file permissions to several various recommendations and back again.


I've also noticed that the profiler page in admin located at Admin > System > Tools > Compilation is completely blank, apart from the nav and footer.

Any help on where to now would be very appreciated. Please ask if anything is unclear. Thanks!

  • 2
    Go to /lib/Varien/Autoload.php on line 93 and use Mage's mageDebugBacktrace() (it's a function, so call it directly). See where did that File.php came from. Use if ($class === 'File') { mageDebugBacktrace(); } so it won't print on every class autoload. I had a similar issue with Ecomdev's PHPUnit module. – nevvermind Oct 9 '13 at 15:55
  • So helpful (for many applications), thanks very much! – Jongosi Oct 10 '13 at 9:43
  • If you only see a blank page - its worth to take a look into the source code – Stefan Jan 14 '16 at 13:18
  • Try to recompil the code<br> System -> Tools -> Compilation -> Run compiation process <br> and Refresh cache. – Nmirach Apr 14 '16 at 11:09
  • @nevvermind i included this code if ($class === 'File') { mageDebugBacktrace(); } in lib/varien/autoload.php as here : pastebin.com/yiZ0cjVy , but still it gave me same issue.... – Baby in Magento Feb 21 '17 at 7:38
6

the Autoload tries to require the file for a class that isn't found in the code base yet. Since it is requiring File.php it stands to reason that somewhere in the code the class File() is called which doesn't exist yet in your codebase.

If you track down the spot where that class is instantiated you will have fixed the issue.

5

For follow-up, the mageDebugBacktrace() provided the following result:

[1] :
[2] :
[3] /var/public_html/domain.com/live/app/code/core/Mage/Core/Model/Cache.php:199
[4] /var/public_html/domain.com/live/app/code/core/Mage/Core/Model/Cache.php:119
[5] /var/public_html/domain.com/live/app/code/core/Mage/Core/Model/Config.php:1348
[6] /var/public_html/domain.com/live/app/Mage.php:462
[7] /var/public_html/domain.com/live/app/code/core/Mage/Core/Model/App.php:401
[8] /var/public_html/domain.com/live/app/code/core/Mage/Core/Model/App.php:295
[9] /var/public_html/domain.com/live/app/code/core/Mage/Core/Model/App.php:337
[10] /var/public_html/domain.com/live/app/Mage.php:683
[11] /var/public_html/domain.com/live/index.php:71

Looking at the Cache.php file, I can see that the 'File' part is the default backend cache type used by Magento, if none is specified. I changed my app/etc/local.xml file to use 'File', note upper case 'F':

File app/etc/local.xml:

<cache>
    <backend><![CDATA[File]]></backend>
    ...
</cache>

Hope that helps someone out.

  • I do not know why Magento documents stuff like that falsely, but the uppercase 'F' did it for me. – func0der Jan 17 '16 at 0:24
  • @Jongosi, your solution is worked for me. Thank you very much. Thanks – abu abu Feb 15 '17 at 6:20
2

Just encountered a weird Warning: include(somefile.php) failed in Autoload.php on line 93 after pulling work on a shared test environment and someone else enabled the cache.

Not this exact case, because it's mentioned:

Ensured that the caches are emptied and indexing has been run several times.

So, always remember to check and disable/clear the cache if working on a shared environment, before wasting hours debugging!

1

This error while creating an object from class like $obj = new GoogleClient(); in Magento it try to find out the class file using Autoload.php

1

It could be also issue with apc cache. Restart apache2 or execute apc_clear_cache(); from php

1

I had this same issue and turns out flushing the redis cache fix it for me.

From command line:

echo 'flushall' | redis-cli -s /path/to/sock

Heres the documentation incase you're not using a socket:

https://briansnelson.com/Install_Redis_Caching_for_Magento

Hope that helps.

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.