CLI Codeigniter controller crash

So I followed this tutorial

http://codeigniter.com/user_guide/general/cli.html

and i tried to do

   php index.php tools message

      

but I am getting this error in terminal:

   <h1>A Database Error Occurred</h1>
   <p>Unable to connect to your database server using the provided settings.</p>
   <p>Filename:/Applications/XAMPP/xamppfiles/htdocs/470repo/projects/main/development/CodeIgniter/third_party/MX/Loader.php</p>
   <p>Line Number: 98</p>   

      

I need this in order to bake assets using the Sprinkle library from https://github.com/edmundask/Sprinkle/wiki/Baking-assets I have been browsing the forum but I cannot find a specific solution to this problem. So, I need to save.

I am using php version 5.3.1 and latest codeigniter.

Any help would be greatly appreciated, thanks! :)

+3


source to share


2 answers


Are you working locally?

If so, try changing the hostname from

$db['default']['hostname'] = 'localhost';

      



:

$db['default']['hostname'] = '127.0.0.1';

      

+7


source


It doesn't seem to be able to connect to your database. Have you checked your database settings in the database.php config file if correct?

If you are using multiple environments, check the part where you install the environment. Perhaps he chose the wrong one.



You can also enable logs in your config.php file and check them.

0


source







All Articles