i\'m trying to run a php script using the heroku scheduler. What command should i put in after the $ in heroku. I keep getting file not found. I have transferred the file i want
The default PHP buildpack on Heroku does not currently have PHP CLI support, so you can only use it to serve web requests via Apache and not for scripts in worker dynos. However, this is possible if you are using a PHP buildpack that does have CLI support.
To test it out, I forked the PHP buildpack, switched out the PHP binary with one that was compiled with CLI support, and put together small demo of running a scheduled PHP job on Heroku. See the project's readme for step-by-step instructions. To use this fork on an existing app, set the buildpack with:
$ heroku config:add BUILDPACK_URL=https://github.com/ryanbrainard/heroku-buildpack-php.git
Note, the release script in my fork sets up the PATH
to resolve the php
executable in /app/bin/php
with just php
, unlike the default buildpack that woud require using the absolute path.