duanji5746 2015-03-09 17:54
浏览 36

在codeigniter 1.6.1中找不到类'控制器'

I'm working on an application in Codeigniter and I want to make once a day cronjobs run by a series of scripts. Earlier this worked correctly on another hosting but after doing a migration has stopped working, because I have to re-create these cronjobs.

I want to run all days this file /web/_cronjobs/application/controllers/updates.php. This performs an update in the database of the internal statistics of the web and the most important, an updated sitemap. This is the code:

http://pastie.org/10012554

I am running this statement from PuTTY:

/usr/bin/php5.5 /kunden/homepages/45/*******/htdocs/web/_cronjobs/application/controllers/updates.php

But it shows me this error:

(uiserver):*********:~ > /usr/bin/php5.5 /kunden/homepages/45/d566577055/htdocs/web/_cronjobs/application/controllers/updates.php
X-Powered-By: PHP/5.5.20
Content-type: text/html

<br />
<b>Fatal error</b>:  Class 'Controller' not found in <b>/homepages/45/d566577055/htdocs/web/_cronjobs/application/controllers/updates.php</b> on line <b>3</b><br />

I've made this possible solution but it still is the same as the version I use codeigniter is 1.6.1 and not 2.0:

codeigniter 2.0 Fatal error: Class 'Controller' not found in

I hope someone can help me, thanks! :)

  • 写回答

2条回答 默认 最新

  • dongle2627 2015-03-09 18:08
    关注

    You have put a controller class into a file and are trying to call it directly. This will not work.

    The reason for your specific error is that the class Controller has not been included. This would normally be done by CodeIgniter when you're running things through the framework. But since you appear to be directly calling the file, CodeIgniter has not been loaded and cannot help you.

    Second, the code in that file is just a class. I see no code that is supposed to interact with the class or anything. Therefore nothing would happen even if the class Controller existed.

    I recommend that you read this short tutorial CodeIgniter - Running via the CLI

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料