views:

59

answers:

2

Hi guys I'm creating a php script that would be called as a cron job. However I need to use the functionalities of the Zend framework. The thing is that relative referencing of files especially in includes don't work when programming for being run via command line so I'm stuck with how do I use the zend libraries here. I don't want to go in and change every single require_once statement.

Please help!

+1  A: 

Your PHP is probably using a different php.ini file when called through the CLI (Command Line Interface).

Use php_sapi_name() to detect whether you're running in CLI mode, and set_include_path() to force the correct include path.

Pekka
+2  A: 

You should be able to use set_include_path to set the include path of the Zend lib.

David Radcliffe