XAMPP中遇未捕获异常:Session驱动'files'未找到,求技术协助
Hey there, let's get this error sorted out for you—no complex dev jargon, just simple steps you can follow.
What's causing this?
This error means your CodeIgniter application can't use the files session driver you have configured. Usually this is either a missing configuration setting, a missing storage folder, or a permission issue.
Step-by-Step Fixes:
Check your Session Configuration File
- Navigate to
C:\xampp\htdocs\reseauxfinal\application\config\config.phpand open it with a text editor (like Notepad or VS Code). - Find the line that says
$config['sess_driver'] = 'files';—make sure it's set exactly to'files'(no typos!). - Next, look for
$config['sess_save_path']. Update this line to point to a valid folder where PHP can store session files. A safe option is:
Or you can use an absolute path:$config['sess_save_path'] = APPPATH . 'sessions/';$config['sess_save_path'] = 'C:\xampp\htdocs\reseauxfinal\application\sessions';
- Navigate to
Create the Session Storage Folder
- If the
sessionsfolder doesn't exist in yourapplicationdirectory, create it right now (just make a new folder namedsessions). - Give this folder write permissions:
- Right-click the
sessionsfolder → Properties → Security tab → Edit. - Select your user account (or "Everyone" for simplicity) and check the Write box under "Allow". Click OK to save changes.
- Right-click the
- If the
Verify PHP Session Settings in XAMPP
- Open your XAMPP Control Panel, click Config next to Apache, then select PHP (php.ini).
- Search for
session.save_handler—ensure it's set tofiles:session.save_handler = files - Search for
session.save_path—you can either leave it blank (so CodeIgniter uses its own setting) or set it to the samesessionsfolder path you used earlier.
Restart Apache
- Go back to XAMPP Control Panel, stop Apache, then start it again. This makes all your configuration changes take effect.
If it's still not working:
Double-check that the file C:\xampp\htdocs\reseauxfinal\system\libraries\Session\drivers\Session_files_driver.php exists. If this file is missing, your CodeIgniter system files might be incomplete—you'll need to re-add this file from a fresh CodeIgniter installation matching your project's version.
内容的提问来源于stack exchange,提问作者Meriem Moussi




