0

I setup a Cron job on my web hosting which runs my code every minute. but I still got an error that I cannot run the script. I do not know whether my command is wrong. here I have attached the coding and the error I got.

below is my PHP code.

$select_user = mysql_query("SELECT * FROM users");
while($row=mysql_fetch_array($select_user)){
    $normal_w = $row['normal_wallet'];
    $interest_w = $row['interest_wallet'];
    $normal_w = $row['normal_wallet'];

    $run_interest = ($normal_w + $interest_w)*0.02;

    $update = mysql_query("UPDATE users SET interest_wallet=interest_wallet-'$run_interest' WHERE status='active'");

}   ?>

The command I use:

my command

The error I get from the email:

error

Can someone help me?

Sourav Ghosh
  • 1,964
  • 4
  • 33
  • 43

2 Answers2

0

You need to use php -q to run php file

so it would be your command

php -q /home/ppfpapaf/public_html/cron_jobs/cron_jobs.php
Niklesh Raut
  • 34,013
  • 16
  • 75
  • 109
0

Hope Something wrong with your command. Thats the reason your cron cannot find a file directory.

Try something Like this in your Command Field:

/usr/local/bin/php /home/ppfpapaf/public_html/cron_jobs.php

Or

/usr/bin/php /home/ppfpapaf/public_html/cron_jobs.php
Muthu17
  • 1,481
  • 12
  • 20