Tutorial :Creating a php script to run as cron job - using Zend Framework library


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!


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.


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

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »