I’m troubleshooting a problem with a plugin and noticed that my database.php cachedir looks a little goofy. Note that I’m using IIS (win 2012).
Does this look right? The double slashes and combo of forward and backwards slashes looks wrong.
$db['expressionengine']['cachedir'] = "D:\\web\\abc\\system/expressionengine/cache/db_cache/";
Also, what is the difference between these two cache settings?
database.php $db[‘expressionengine’][‘cachedir’] = “path”;
config.php $config[‘cache_path’] = “”;
If I look in this folder, I do see some files in it that get modified when I log into the EE control panel (current_version & software_registration).
D:\web\abc\system\expressionengine\cache
I don’t see a db_cache directory though like my cachedir path is set for.
Hi Chris,
2.x has a separate cache for the database, distinct from the general purpose cache directory. As for your path setting for the cachedir
, I would convert it to use either forward slashes or backslashes. The backslashes are doubled up because of how PHP handles the \
character in strings.
Hi Seth,
As far as the $db[‘expressionengine’][‘cachedir’] path, when I install a fresh copy of EE 2.11.1 it auto creates this path, based on the system folder name I presume, and it’s adding the double and mixed slashes.
Is this a bug with EE on Windows? Will it work anyway configured like this?? How can I test it to tell that it’s functioning as intended?
I tried it with all double forward slashes // and the EE CP still loads.
I tried it with all double back slashes \ and the EE CP still loads.
… as well as the way EE creates originally.
However I never see a /db_cache folder created so I don’t know if it’s truly working beyond the site loading.
Thanks, Chris
Hi Chris,
The funny thing about the db_cache folder, it’s not used unless CodeIgniter’s cache setting is turned on. CI’s database drivers need a value for that path, but we never use their caching. So…that’s not a config value that is really being used and in fact we dropped it entirely for 3.x.
From my testing on a Windows 2012r2 server running IIS 8.5.
Fails with http error 500, EE CP doesn’t load: $db[‘expressionengine’][‘cachedir’] =
'D:\wwwdata\eetestsite\system\expressionengine\cache\db_cache\'; (single backwards)
Works:
$db['expressionengine']['cachedir'] = 'D:\wwwdata\eetestsite\system/expressionengine/cache/db_cache/'; (mixed single)
$db['expressionengine']['cachedir'] = 'D:/wwwdata/eetestsite/system/expressionengine/cache/db_cache/'; (single forward)
$db['expressionengine']['cachedir'] = 'D:\\wwwdata\\eetestsite\\system\\expressionengine\\cache\\db_cache\\'; (double backwards)
$db['expressionengine']['cachedir'] = 'D://wwwdata//eetestsite//system//expressionengine//cache/db_cache//'; (double forward)
$db['expressionengine']['cachedir'] = 'D:\\wwwdata\\eetestsite\\system/expressionengine/cache/db_cache/'; (mixed, EE default)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.