You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

XAMPP中遇未捕获异常:Session驱动'files'未找到,求技术协助

Fixing the "Session: Configured driver 'files' not found" Error

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:

  1. Check your Session Configuration File

    • Navigate to C:\xampp\htdocs\reseauxfinal\application\config\config.php and 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:
      $config['sess_save_path'] = APPPATH . 'sessions/';
      
      Or you can use an absolute path:
      $config['sess_save_path'] = 'C:\xampp\htdocs\reseauxfinal\application\sessions';
      
  2. Create the Session Storage Folder

    • If the sessions folder doesn't exist in your application directory, create it right now (just make a new folder named sessions).
    • Give this folder write permissions:
      • Right-click the sessions folder → PropertiesSecurity tab → Edit.
      • Select your user account (or "Everyone" for simplicity) and check the Write box under "Allow". Click OK to save changes.
  3. 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 to files:
      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 same sessions folder path you used earlier.
  4. 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

火山引擎 最新活动