如何在 Linux/Apache 虚拟主机上运行 win32 控制台应用程序?
How to run a win32 console application on Linux/Apache web-hosting?
可执行文件使用2个非托管dll并在控制台上提供输出。 我目前正在XAMPP/localhost(在我的PC上(上运行它,并使用PHP的Exec((/PassThru((函数获取控制台输出。
它会在典型的基于 Apache/Linux 的 Web 托管帐户上运行吗?如果没有,我该怎么办?
在 PHP 中:
<?php
exec("TradeLogin.exe",$output);
//TradeLogin.exe is the win32-console-app,
//situated at Xampp/htdocs, with couple of supporting binary files & dlls
//(compiled on Visual-Studio-2015)
echo $output[0]."<br/>";
echo $output[1]."<br/>";
?>
我不知道它是否会有权限问题(我在 Windows 自动取款机上,所以不能尝试。
如果你想让它以这种方式运行,你需要一个Windows模拟器(例如Wine(,并像
exec("wine TradeLogin.exe 2>&1",$output);
或者可能需要完整路径。请注意,PHP 代码的执行将停止,直到程序完成运行。
相关文章:
- C++线程:如何在一个线程仍在运行时阻止另一个线程执行 (Win32)
- C++ DLL 运行时错误"abc.dll is not a valid WIN32 application" 。请帮助解决这个问题
- Win32 函数可以在同一线程上异步运行吗?
- 如何检查 win32 exe 文件是否已运行?(使用 win32 API 代码)
- 如何在 Linux/Apache 虚拟主机上运行 win32 控制台应用程序?
- Exe不是有效的win32应用程序,但在64位上运行
- 是否可以在Windows 8环境上在Visual Studio 2005上运行VC ,Win32应用程序
- Win32 控制台代码在哪里运行?从多个线程使用时控制台挂起
- 如何将任何 *.jpg图像嵌入Win32可执行文件中并在运行时使用它
- 使用文件I/O正确创建和运行win32服务
- C++Win32 在低优先级模式下运行应用程序/线程
- CMake:运行链接命令时出错:%1不是有效的Win32应用程序
- 运行时的 win32 控件
- 什么可能导致我的 C++ win32 应用程序在后台运行
- OpenSSL 在作为 win32 服务运行时SSL_CTX_new崩溃
- 从支持/clr的win32 C++运行C#
- WinXP上具有C运行库libs 2011的Win32程序无效
- 如何防止Win32应用程序在主窗口关闭后在后台运行
- Win32 应用程序在启动时不运行
- c++ WIN32:运行没有命令提示符窗口的程序