php exec可以';尽管请求的路径正确,但找不到Java JVM dll
我有以下PHP代码:php exec可以';尽管请求的路径正确,但找不到Java JVM dll,java,php,dll,jvm,exec,Java,Php,Dll,Jvm,Exec,我有以下PHP代码: $compileCSS = "C:\ApacheFlexSDK\bin\mxmlc.exe C:\inetpub\utils\css\\". $_POST['cssFileName'] . ".css" . " 2>&1"; exec ( $compileCSS, $output ); // uncomment to see the response to command print_r($output); C:\ApacheFlexSDK\bin\mxm
$compileCSS = "C:\ApacheFlexSDK\bin\mxmlc.exe
C:\inetpub\utils\css\\". $_POST['cssFileName'] . ".css" . " 2>&1";
exec ( $compileCSS, $output );
// uncomment to see the response to command
print_r($output);
C:\ApacheFlexSDK\bin\mxmlc.exe
C:\inetpub\utils\css\sample.css 2>&1
Array ( [0] => Error loading: C:\Program Files (x86)\Java\jre1.8.0_121\bin\client\jvm.dll )
它运行如下命令:
$compileCSS = "C:\ApacheFlexSDK\bin\mxmlc.exe
C:\inetpub\utils\css\\". $_POST['cssFileName'] . ".css" . " 2>&1";
exec ( $compileCSS, $output );
// uncomment to see the response to command
print_r($output);
C:\ApacheFlexSDK\bin\mxmlc.exe
C:\inetpub\utils\css\sample.css 2>&1
Array ( [0] => Error loading: C:\Program Files (x86)\Java\jre1.8.0_121\bin\client\jvm.dll )
当我运行此命令时,会出现以下错误:
$compileCSS = "C:\ApacheFlexSDK\bin\mxmlc.exe
C:\inetpub\utils\css\\". $_POST['cssFileName'] . ".css" . " 2>&1";
exec ( $compileCSS, $output );
// uncomment to see the response to command
print_r($output);
C:\ApacheFlexSDK\bin\mxmlc.exe
C:\inetpub\utils\css\sample.css 2>&1
Array ( [0] => Error loading: C:\Program Files (x86)\Java\jre1.8.0_121\bin\client\jvm.dll )
C:\ProgramFiles(x86)\Java\jre1.8.0\u 121\bin\client\jvm.dll
是正确的,并且这里有一个jvm.dll
当我直接从命令行运行该命令时,它工作正常,即生成一个SWF文件(mxmlc是ApacheFlex编译器)
找不到如何解决此问题,请提供帮助。如果应用程序的参数有空格,则必须使用path或双引号将其包装到应用程序:
$cmd = 'targetapp.exe "C:\my other path with spaces\targetfile.xxx"';
exec($cmd);
$cmd = '"C:\my path with spaces\targetapp.exe" C:\mypathnospaces\targetfile.xxx';
exec($cmd);