SMF Support > phpBB

Errors after conversion


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

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: --- require($cachedir . '/data_' . $key . '.php');
--- End code ---


--- Code: --- @include($cachedir . '/data_' . $key . '.php');
--- End code ---

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.

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.


[0] Message Index

Go to full version