Executing a java program via php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
premtemp
Forum Newbie
Posts: 3
Joined: Sat Feb 02, 2008 8:02 am

Executing a java program via php

Post by premtemp »

Hello,
How do I launch a java program from PHP. I tried the following from a webpage and get no error but it did not launch the progran.

$param = "\\\\usbocc00001srv\\ftp\\rtt\\file1.gzz"
$str = "java -Xms256m -Xmx512m -jar \\\\usbocc00002srv\\P.JAR $param"
$out= exec($str);

I can execute this program from the windows prompt.

Thanks in advance for any help
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: Executing a java program via php

Post by WebbieDave »

You must have permissions to run programs from PHP (ie: safe mode Off). Check your phpinfo() to see the safe mode setting.
Post Reply