php - How to set a file in cron job -


I need to run a php file every minute, so I tried to set up the cronabose with cPanel but with this message Sending mail "Input file can not be opened:"

My php file is inside public_html / schoolerp / cron.php

I did:

/ usr / local / bin / php -f /public_html/schoolerp/cron.php

Am I doing something wrong, please tell me whether I am setting it up correctly, and If i am wrong please Help it to correct ...

"post-text" itemprop = "text">
  • Use the full path
  • Make sure that The script is accessible, check access
  • The cronx will take all the output of your script by default and send it to your email

You can redirect the output of your command Can I stop sending the email to prevent the cron file or to / dev / null in the local file for future references I will suggest to Nupreshit, it is good for debugging and when something goes wrong.

I think that should do something like this:

  / usr / local / bin / php -f /public_html/schoolerp/cron.php> /logs/mylog.txt 2 & gt; & Amp; 1  

Redirect to mylog.txt file and add stdout to stdout so that both stderror and stdout are in the log file.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -