How to determine the environment in a cronjob How to determine the environment in a cronjob codeigniter codeigniter

How to determine the environment in a cronjob


You can pass server name in cron job. Example if your current php command look likes.

php a.php --uri="/foo"

It will become

SERVER_NAME=dev.domain.com php a.php --uri="/foo"