PHP Cronjob每分钟都运行不起作用

时间:2021-11-04 04:02:18

on 1and1 server/ linux i want to run a php file to redirect to a url every minute (using php header)

在1and1 server / linux上我想运行一个php文件每分钟重定向到一个url(使用php标头)

*/1 * * * * /usr/bin/php /kunden/homepages/XXXXXX/XXXXXX/htdocs/cron.php

i entered this command but not working...

我输入了这个命令但没有工作......

file is exist and php code work fine, file path is correct. i searched many times to check my command is correct or not, but i'm sure command is ok.

文件存在且php代码工作正常,文件路径正确。我多次搜索检查我的命令是否正确,但我确定命令没问题。

in php file, it will redirect to a url, that url will save data to database. i checked every minute but looks like php file not redirected.

在php文件中,它会重定向到一个url,该url会将数据保存到数据库中。我检查每一分钟,但看起来像PHP文件没有重定向。

1 个解决方案

#1


0  

@Alipour, Please check below points for CRON Job.

@Alipour,请查看下面的CRON Job点数。

1. Check your file path is appropriate or not.

1.检查文件路径是否合适。

2. If file path correct, then check file execute or not. (You can check file execution through send an test email or write output in to any text file).

2.如果文件路径正确,则检查文件是否执行。 (您可以通过发送测试电子邮件或将输出写入任何文本文件来检查文件执行情况)。

3. You need to create code of save your data in to that file itself,because CRON Job not provide such type of functionality that redirect to any other URL. Redirection of any other URL in cron won't be work.

3.您需要创建将数据保存到该文件本身的代码,因为CRON Job不提供重定向到任何其他URL的此类功能。在cron中重定向任何其他URL都不起作用。

Let me know if you still have any questions.

如果您还有任何疑问,请与我们联系。

#1


0  

@Alipour, Please check below points for CRON Job.

@Alipour,请查看下面的CRON Job点数。

1. Check your file path is appropriate or not.

1.检查文件路径是否合适。

2. If file path correct, then check file execute or not. (You can check file execution through send an test email or write output in to any text file).

2.如果文件路径正确,则检查文件是否执行。 (您可以通过发送测试电子邮件或将输出写入任何文本文件来检查文件执行情况)。

3. You need to create code of save your data in to that file itself,because CRON Job not provide such type of functionality that redirect to any other URL. Redirection of any other URL in cron won't be work.

3.您需要创建将数据保存到该文件本身的代码,因为CRON Job不提供重定向到任何其他URL的此类功能。在cron中重定向任何其他URL都不起作用。

Let me know if you still have any questions.

如果您还有任何疑问,请与我们联系。