Welcome Guest, Not a member yet? Register   Sign In
PHP won't run model functions from terminal
#2

[eluser]CroNiX[/eluser]
My guess is that your app is relying on some $_SERVER variables, like $_SERVER['HTTP_HOST'] or similar, in order to do things like determine the database to use, etc. A lot of people use that to set their environment variables.

Problems can happen when accessing from the CLI because those variables aren't present (since the request isn't coming from a browser) and so it can't operate properly.

It's the main reason I've always used this method, as it allows you to set those variables as part of the CL request, or when used in a cron job. It's just more flexible.


Messages In This Thread
PHP won't run model functions from terminal - by El Forum - 06-04-2012, 12:27 AM
PHP won't run model functions from terminal - by El Forum - 06-04-2012, 10:26 AM
PHP won't run model functions from terminal - by El Forum - 06-04-2012, 12:55 PM
PHP won't run model functions from terminal - by El Forum - 06-04-2012, 01:10 PM
PHP won't run model functions from terminal - by El Forum - 06-04-2012, 01:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB