I am making an online judge. It is a school project. I am using CodeIgniter. I am also using xampp. Now I need to give a command to the command prompt from my controller. I have tried using the system function and the exec function, but it still isn’t working. My code was
exec('my command');
system('my command');
These are not working. Am I using then correctly or is there a problem with the argument?
First and as already mentioned: Use mkdir for creating directories.
Second: What is
mdsupposed to do? The command here ismkdir, too. And thirdly, consideringexec, take a look at theexecfunction:string exec ( string $command [, array &$output [, int &$return_var ]] )So what you can do (if you want to stick to
execfor whatever reason or for future use cases):This will tell you what went wrong with your command execution.