PHP exec java on IIS 7

ぐ巨炮叔叔 提交于 2019-12-25 01:49:14

问题


I am trying to exec a java jar file using php exec();

The command is

"C:\Program Files\Java\jdk1.5.0_15\bin\java.exe" -jar "C:\batik\batik-rasterizer.jar" -m image/png -d "C:/path/to/file/filename.png" -w 800 "C:/path/to/file/filename.svg"

When I run this command on the server using CMD.exe or Power Shell works fine but when I run it with PHP using exec() or system() or shell_exec() it will not execute returning a blank page


回答1:


OK I got it figured out,

First the java jdk shouldn't be installed in the programs folder for some reason iis_iusrs doesn't have the permission to execute any files there.

Secondly the code should look like this

exec("C:\\Java\\jre6\\bin\\java.exe -jar C:\\batik\\batik-rasterizer.jar -m image/png -d "C:\\path\\to\\file\\filename.png" -w 800 "C:\\path\\to\\file\\filename.svg");


来源:https://stackoverflow.com/questions/6155153/php-exec-java-on-iis-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!