• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Error when running via command line

#1
[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?

Thanks!

#2
[eluser]dmorin[/eluser]
Did you ever figure this out? I'm having the same issue running CLI on OS X.

#3
[eluser]dmorin[/eluser]
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

Code:
php script.php

you need to run

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

#4
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.