Cron job not working Ubuntu Lemp stack

July 19, 2015 5.1k views
Linux Commands PHP DigitalOcean LEMP Ubuntu

I have a problem getting a cron job to work with my Lemp stack.
I have a tracker installed (CPVLab) that requires two php scripts run with cron jobs.
One appears to be working with wget and url to php script. I can see start and finished entries in CPVLab error log.
I tried running the other cron job with wget but it starts and never finishes then gives php errors.,
I am now trying this syntax:
*/15 * * * * php -f /var/www/
This gives the same problem, starts then does not finish.
CPVLab is encoded with ioncube but maybe that’s not the issue here.
Advice much appreciated.

  • Does running the command manually work? php -f /var/www/

  • Thanks for reply
    Hmm interesting…when I paste the command manually in a terminal I get an ioncube loaders error.
    My says that ioncube is installed but clearly there is an error somewhere.

  • @zx1905cc I’m guessing that the ioncube loader extension is configured for php5-fpm/mod_php but not the cli version of PHP. You’ll need to copy the ioncube.ini file from /etc/php5/apache2/conf.d/ to /etc/php5/cli/conf.d/.

  • Thanks for reply

    /etc/php5/ “ apache2 not at this location”
    and /etc/php5/cli/conf.d/. does not contain an ioncube.ini file
    I built the Lemp stack using “easy engine” is the file structure different?
    Learning as I go here!

  • @zx1905cc Oh, a LEMP stack uses php5-fpm so you’ll find the ini file in /etc/php5/fpm/conf.d.

  • Show 2 more comments
1 Answer

Try using the full PHP CLI path,

 */15 * * * * php -f /var/www/

Also this Q&A might have a solution -

  • Thanks for reply
    Q+A was interesting but dont have the same error..seems I am not alone with CPVLab problems.

Have another answer? Share your knowledge.