我正试图通过cli使用codeigniter函数,但它显示错误
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Msg_controller extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function send_in_background($key_with_info){
echo "working";
log_message("error","Key ".$key_with_info);
}
}
像这样称呼它-:
php index.php cli/msg_controller/send_in_background'12547'
错误
PHP警告:mkdir((:第131行/var/www/html/pro/system/core/Log.PHP中的路径无效
若我在浏览器中调用相同的函数,那个么它运行良好。
http://localhost/pro/cli/msg_controller/send_in_background/12547
通过CLI运行的正确方式是
php path/to/index.php controller method params
在您的情况下:
php index.php msg_controller send_in_background 12547
试试