Skip to content
Advertisement

CodeIgniter without a Database?

Sorry if this is a simple question, is it possible to load codeigniter without a db setup?

I have sess_use_db set to false in the config, I tried renaming database.php to something else but it still wants to load it, I turned active records off also.

I tried commenting everything out in the database.php and it said no database settings found, autoload doesn’t load the db.

Is this even possible?

Advertisement

Answer

Theoretically, there should be no reason that CI needs a database. sess_use_db=false just stops CI from storing it’s session information in a database. Check that you are not autoloading the database files in config/autoload.php

You could set the database type to ‘sqlite’ in config/database.php if you simply want to avoid setting up mysql, but you will need to have sqlite installed.

HTH

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement