Author Topic: Errors after conversion  (Read 5012 times)

Offline Mike72

  • Semi-Newbie
  • *
  • Posts: 94
Errors after conversion
« on: January 28, 2012, 11:09:43 AM »
Hi guys,

I get the following 2 errors after converting from phpbb3. It happens a few times a day but other then that everything seems to be working good.

Warning: require(/home/content/83/7482583/html/smf/cache/data_39d160e19fc0cdb1a341150dba8744b1-SMF-modSettings.php) [function.require]: failed to open stream: No such file or directory in /home/content/83/7482583/html/smf/Sources/Load.php on line 2699

Fatal error: require() [function.require]: Failed opening required '/home/content/83/7482583/html/smf/cache/data_39d160e19fc0cdb1a341150dba8744b1-SMF-modSettings.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/83/7482583/html/smf/Sources/Load.php on line 2699

Thanks for any help

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,882
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Errors after conversion
« Reply #1 on: January 28, 2012, 02:24:36 PM »
It's an issue with the file caching system. Basically, SMF determined that the file existed, but it didn't exist by the time that SMF tried to include it. As far as I can tell, it can only happen if two users try to access the file at almost the exact same time, right around the time that the file expires.

The only way I can think of to get around this issue (other than asking your host to install a PHP-based cache such as APC) is to make a slight change to the code:


Code: [Select]
require($cachedir . '/data_' . $key . '.php');
Code: [Select]
@include($cachedir . '/data_' . $key . '.php');
This change does two things:
1. Using include() instead of require() will prevent the script from dieing if the file can't be included.
2. The @ will suppress the warning generated by include() if the file doesn't exist.

That should solve your problem.
Michael Eshom
Cincy Space - now open!

Offline Mike72

  • Semi-Newbie
  • *
  • Posts: 94
Re: Errors after conversion
« Reply #2 on: January 28, 2012, 02:41:37 PM »
Thanks so much Oldiesmann. That took care of the problem.
I'm not sure if it's related or not but my site is loading way faster now.