1
I’m trying to make a cronjob run in the IC, but I’m not getting, this error appears:
Fatal error: Class 'Ci_controller' not found in /Meucaminho/application/controllers/cron.php online 4
PHP
<?php
class Cron extends CI_Controller{
//put your code here
public function index(){
$arq = fopen("teste_cron.txt", "a+");
fwrite($arq, "=======================TESTE CRONTAB======================================\n");
fwrite($arq, "O CronTab executou este código na Data/Hora: ".date("d/m/Y H:i:s")."\n");
fwrite($arq, "==========================================================================\n");
fclose($arq);
}}
WAY
php -q /home/user/public_html/caminho_completo/application/controllers/cron.php
Can anyone tell me how to do it?
I suggest not using a controller, but a simple php file.
– Rodrigo Mello