前提・実現したいこと
CodeIgniter2.2.0でcronを実行したいがエラーが出るので、正常に動くように問題を解決したいです。
質問の内容
phpを書いてcronを10分おきに実行しようとしたら、Linux上で【/var/spool/mail/username】宛てに以下のエラーメッセージが返ってきました。
発生している問題・エラーメッセージ
PHP Fatal error: Class 'CI_Controller' not found in /var/www/※ファイルパス※/controllers/test.php on line 8 Fatal error: Class 'CI_Controller' not found in /var/www/※ファイルパス※/controllers/test.php on line 8
phpファイル
<?php set_time_limit(0); require_once 'goutte.phar'; use Goutte\Client; class test extends CI_Controller { public function __construct(){ parent::__construct(); ini_set('error_reporting', E_ALL); $this->load->model('Core_model'); $this->load->model('test_model'); $this->load->helper(array('form', 'url')); } public function index(){ // 省略 } }
cron
*/10 * * * * php /var/www/※ファイルパス※/controllers/test.php test index
試したこと
「Fatal error: Class 'CI_Controller' not found」等で、6時間くらいググってしばらく原因を追求しましたが、根本的な解決策が見つかりませんでした。
直接問題を解決できる回答でなくても、なにか解決の可能性となるヒントがあればお伺いしたいです。
なお、CodeIgniterを導入し、設定したのは私ではないため、質問を受けた場合明確な回答ができかねる場合があり、ご容赦いただけますと幸いです。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/14 07:18