Ferramentas do usuário

Ferramentas do site


php:application_env

http://stackoverflow.com/questions/7781784/setting-zend-application-env-for-command-line-scripts

Get APPLICATION_ENV on CRON

From a terminal

For (linux)command-line only usage you could add following line to your ~/.bashrc

export APPLICATION_ENV=“development”
Or add the line to /etc/profile to set the environment variable for all users.

For more information

Howto: Set environment variables in Windows 7
Howto: Set environment variables in Linux

From a crontab

Cron uses a clean/empty environment and doesn't look at /etc/profile or ~/.bashrc for the APPLICATION_ENV or other environment variables.

Just define the environment variable inside the crontab:

APPLICATION_ENV=development
0 0 * * *   /usr/bin/php /path/to/your_script.php

For more information

php/application_env.txt · Última modificação: 2022/05/25 16:24 por 127.0.0.1