简体   繁体   English

PHP Cron作业错误本地Xampp Ubuntu

[英]PHP Cron Job Error Local Xampp Ubuntu

How to Set PHP Cron Job ?  
Steps Which I Followed.  
Step 1 : I run below Command.   
swapnil@UBUNTU1:~$ whereis php  
o/p :  
/usr/bin/php 
/usr/bin/php7.0 
/usr/lib/php 
/etc/php 
/usr/share/php7.0-opcache 
/usr/share/php7.0-readline 
/usr/share/php7.0-common 
/usr/share/php7.0-mbstring 
/usr/share/php7.0-zip 
/usr/share/php7.0-xml 
/usr/share/php 
/usr/share/php7.0-json 
/opt/lampp/bin/php 
/usr/share/man/man1/php.1.gz

Step 2: I Run Below Command  
swapnil@UBUNTU1:~$ */10 * * * * /usr/lampp/bin/php  
/opt/lampp/htdocs/cron_job/cron.php

Error : bash: */10: No such file or directory. 错误:bash:* / 10:没有这样的文件或目录。
Here I want to set my cron job locally after every 10 minute 我想每10分钟在本地设置我的cron工作

Your cron is probably good, but you put it at the wrong place. 您的cron可能不错,但是您将其放在错误的位置。 if you want to test it, try : 如果要测试,请尝试:

$ /usr/lampp/bin/php /opt/lampp/htdocs/cron_job/cron.php

Then to add it as a CRONTAB, you have to edit the crontab file : 然后要将其添加为CRONTAB,您必须编辑crontab文件:

$ crontab -e

And add it to the end of the file. 并将其添加到文件末尾。

for more : https://www.computerhope.com/unix/ucrontab.htm 更多信息: https : //www.computerhope.com/unix/ucrontab.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM