Welcome Guest, Not a member yet? Register   Sign In
Database Error when running via command line

[eluser]Paul Wenzel[/eluser]
I am attempting to run a CodeIgniter app via the OSX command line. The goal is to automate webkit2png, which needs to be run from a local account (not Apache).

After following the CronScript instructions in the wiki, I am getting the error Unable to connect to your database server using the provided settings.

This error message appears only when I run the script via the command line PHP binary, but not when I run it through my web server (in my web browser). Anyone else run in to database issues when doing CI command line?


Did you ever figure this out? I'm having the same issue running CLI on OS X.

Just in case anyone is still looking for the answer, it looks like the php version that comes with os x is missing some things from the cli.

So, if you're running MAMP (or something similar) instead of just running

php script.php

you need to run

/Applications/MAMP/bin/php5/bin/php script.php

[eluser]Paul Wenzel[/eluser]
Very interesting! I was using Marc Liyanage's PHP 5 binary (from entropy.ch) for my web server. When I ran it from the CLI, it was probably using OSX's built in version of PHP. I'll have to give it another go this weekend.

Theme © iAndrew 2016 - Forum software by © MyBB