首页 > 解决方案 > PHP exec() 从 CMD 编译 VB6

问题描述

我对 PHP 很陌生,我需要从 Windows 命令提示符编译一个 vb6 项目。我已经尝试了一切,但似乎没有任何效果,甚至创建一个批处理并从 PHP 代码执行,没办法......(如果从 cmd 本身启动批处理工作)。我还用各种路径定义了变量,但没有成功。IE:

$cmd = ('vb6.exe -MAKE D:\Websites\devopservices\dlledit\portaleeditorisen\NewSecurity\Data\NewSecurity_data.vbp D:\Websites\devopservices\dlledit\compiled\test.dll');
echo exec($cmd);

或插入带有变量的路径:

$proj = 'D:\Websites\devopservices\dlledit\portaleeditorisen\NewSecurity\Data\NewSecurity_data.vbp';
$dll = 'D:\Websites\devopservices\dlledit\compiled\test.dll';

这是我需要执行的完整命令:

<?php
echo exec('"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" /MAKE D:\Websites\devopservices\dlledit\portaleeditorisen\NewSecurity\Data\NewSecurity_Data.vbp D:\Websites\devopservices\dlledit\compiled\NewSecurity_Data.dll');
?>

谢谢你的帮助。

标签: php

解决方案


我解决了,这不是 php 问题,而是与 IIS 应用程序池中的身份有关 :-)


推荐阅读