I want to utilize a .cgi file in a function call within my model:
function execute_shell_command($userID,$clientname){
$shell_script_to_execute="jobscript.cgi";
$jobtype="clientjob";
echo shell_exec("bash '".$shell_script_to_execute."' '".$jobtype."' '".$userID."' '".$clientname."' '".$this->job_command."' '".$this->job_id."' '".$this->servername."开发者_StackOverflow社区' '".$this->rootaccess."' ");
}
How do I load this cgi file, right now I don't know where to put it. In my assets folder? Just looking for a good way to do it in codeigniter
File paths in codeigniter are always relative to index.php
so if your cgi-bin directory is sitting at the same level as your index.php
$shell_script_to_execute = "./cgi-bin/jobscript.cgi";
should work...
精彩评论