Calling java from PHP exec

前端 未结 4 945
陌清茗
陌清茗 2020-12-01 15:17

I am doing the following in PHP:

exec(\'java -jar \"/opt/flex3/lib/mxmlc.jar\" +flexlib \"/opt/flex3/frameworks\" MyAS3App.as -default-size 360 280 -output M         


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 15:44

    Turns out it was a bug specific to the PHP stack MAMP (http://www.mamp.info/).

    Turns out any invocation of the JVM following fails under MAMP, e.g.:

    exec('java -version');
    

    The fix is to prefix the command with

    export DYLD_LIBRARY_PATH="";
    

    Also I realized there's no reason to use that method of invoking mxmlc.

    So here's the final, working command:

    exec('export DYLD_LIBRARY_PATH=""; mxmlc MyAS3App.as -default-size 360 280 -output MyAS3App.swf');
    

提交回复
热议问题