Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cron作业不适用于php函数?_Php_Codeigniter_Cmd_Cron_Crontab - Fatal编程技术网

Cron作业不适用于php函数?

Cron作业不适用于php函数?,php,codeigniter,cmd,cron,crontab,Php,Codeigniter,Cmd,Cron,Crontab,我正在使用PHP5.3.3和Apache2.0以及codeigniter框架。在这方面,我为下载文件设置了cron作业,每分钟一次。当我通过url运行我的函数时,它正在工作。但在cron中,作业集意味着不工作。我使用root登录设置了cron并签入cmd,它显示它正在运行。这是我的网址 但它没有下载任何文件。因此,我必须检查使用DB insert而不是下载代码。因为这也不起作用。下面我给出了cron集代码 crontab -e -u myusername */1 * * * * wget -O

我正在使用PHP5.3.3和Apache2.0以及codeigniter框架。在这方面,我为下载文件设置了cron作业,每分钟一次。当我通过url运行我的函数时,它正在工作。但在cron中,作业集意味着不工作。我使用root登录设置了cron并签入cmd,它显示它正在运行。这是我的网址

但它没有下载任何文件。因此,我必须检查使用DB insert而不是下载代码。因为这也不起作用。下面我给出了cron集代码

crontab -e -u myusername

*/1 * * * * wget -O - http://ef.efvoice.com/artbak/index.php?module=sales&view=auto_download

*/1 * * * * lynx http://ef.efvoice.com/artbak/index.php?module=sales&view=auto_download

/etc/init.d/crond restart
我在cron
wget-o
lynx
中都设置了这两种方法。但当我在同一cmd模式下检查时

tail /var/log/cron 
它显示它正在运行。我不知道我犯了什么错误。所以请任何人帮助我。提前谢谢

我也尝试过这些步骤,检查屏幕截图,但不起作用。如果还有其他方法的话


尝试使用服务器路径

php -f /home/usr/public_html/ef.efvoice.com/artbak/index.php

你需要在一个没有登录要求的页面上

我尝试了很多方法,最后我找到了解决方案。问题是在我的url前后缺少要添加的单引号。现在,这是完美的工作。谢谢你们这么多支持/指导我的人


curl——请求获取'http://ef.efvoice.com/art/index.php?module=auth&view=auto_download“

我的服务器托管在新加坡,所以我从印度访问,这可能会产生任何问题吗?我不知道它为什么不工作?可能是路径问题,我的文件路径/var/www/html/。。。。。。。这样地。或者有许可问题吗?请引导我。这个条目可能是你的解决方案:我已经检查了你的链接,也尝试了,没有工作。检查我上面的图片。在没有登录的情况下更改了代码,并尝试了很多方法,但都不起作用。检查我的屏幕截图。如果使用服务器路径,请尝试:php-f/home/usr/public\u html/ef.efvoice.com/artbak/index.php控制器\u name方法\u name检查CLI的手册页: