Passing parameters with usr / bin / php p in cron jobs

I have a problem creating a cron task. I created a task and it works fine on my server if I run the following command:

php symfony namespace:taskname

      

In the crontab, I use the following command:

usr/bin/php /home/user/mysite/symfony namespace:taskname

      

If I run this command, I only get a list of commands symfony

. In other words, it looks the same as if I entered only php symfony

. Somehow the part is namespace:taskname

not transferred.

Any ideas?

+3


source to share


1 answer


first you need to write syntax like

X X X X X  usr/bin/php /home/user/mysite/symfony namespace:taskname

      



where X X X X X

is the time period during which you want to run the command. also set the time according to the time of your task. it can overlap time.

still the same problem, maybe your timezone is out of order in php.ini file. set timezone in php.ini file.

0


source







All Articles