php 的系统() 函数不起作用


System() function of php not working

$output = system('SET PATH=%PATH%;C:'xampp'GCC G++ compiler'bin && cd/ && c: && cd xampp'htdocs'College Coding'lessons'HTML && g++ -o temp temp.cpp && temp.exe > output.txt',$ret);

temp.cpp 没有在我的机器中编译。我试过另一个,它正在工作。它不是在创造output.txt

输出.txt应该包含什么?您是否正在尝试在 $output var 中获取命令输出?您可以使用直通

直通("your_command", &$output(;

然后$output将包含命令的所有输出

阿纳斯