如何在Linux上使用php获得c++编译结果
how to get c++ compile results on linux with php
我想获得编译错误与php。我可以接受一些命令的输出,但我不能接受编译命令的输出。例如:
$compileCode = "g++ -o program program.cpp";
$output = `$compileCode`;
是行不通的。但
$output = `ls -l`;
作品尝试将stderr重定向到stdout:
$compileCode = "g++ -o program program.cpp 2>&1";
$output = `$compileCode`;
如果您只想看到错误,您也可以将stdout重定向到/dev/null
:
$compileCode = "g++ -o program program.cpp 2>&1 1>/dev/null";
$output = `$compileCode`;
相关文章:
- 正在查找文档以获得PS4平台的C++中的设备信息
- 如何从C++中的依赖类型中获得它所依赖的类型
- 欧拉项目#8答案是大以获得有效答案
- 如何使用C/C++在MacOSX中获得键盘布局
- 如何在不产生任何垃圾的情况下获得C中的像素
- 有没有一种方法可以在编译时获得作用域类名
- 如何在C++中获得"静态纯虚拟"功能?
- 如何设置一个范围来提取我想要获得的信息
- 在多次运行中获得一致的callgrind输出
- 通过错误处理,在C++中可靠地获得用户十六进制输入
- 如何在Directwrite中获得给定字体的可用OpenType功能
- 在我的代码中,获得最大的Pair Wise产品C++和输出并不总是正确的
- 当用户在qtablewidget中输入单元格时,如何获得信号?C++
- 未获得字符串中的预期输出
- C++需要帮助从用户那里获得一个整数,并确保它在另外两个整数之间
- Qt:当QListView获得新条目时,如何更新QStringList
- 如何在卷曲中获得卷曲/卷曲.h?
- 如何将JSON发送到PHP脚本并使用QT获得答案
- 调用运行程序并在php中获得响应
- 如何在Linux上使用php获得c++编译结果