Search code examples
croncron-task

cron cannot run composer


I setup composer by following this guide: http://codybonney.com/installing-composer-globally-on-centos-6-4/

it is ok. I could run composer globally.

The problem is that I want to run composer update with cron job.

05 15 * * * cd ~/myproject && composer update --no-dev > ~/composer.tx

error: /bin/sh: composer: command not found

Please help me

Thanks


Solution

  • I solved my problem by using full path to composer installed folder

    05 15 * * * cd ~/myproject && /usr/local/bin/composer update --no-dev > ~/composer.tx