Help with executing a Jar file in 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
HNH992
Forum Newbie
Posts: 2
Joined: Sun Jun 27, 2010 3:34 am

Help with executing a Jar file in PHP

Post by HNH992 »

Hi
I have Jar file which does some modifications to ZIP files.
I want to execute the jar file by using PHP.
I wrote like this code:
php Code:

<?php
shell_exec('java -classpath testsign.jar testsign test.zip test2.zip');
?>

The jar file: testsign.jar
After executing the jar file, It will modify test.zip and create the modified file test2.zip.

I tried this code in AppServ and it worked.
so I uploaded it to my website and I tried it but it didn't work.
It doesn't create test2.zip
I turned off the Safe Mode and made the chmod is 777. But didn't work.



What the problem??

P.S: My hosting from Servage : http://www.servage.net

Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Help with executing a Jar file in PHP

Post by requinix »

The host does have Java installed, right?
HNH992
Forum Newbie
Posts: 2
Joined: Sun Jun 27, 2010 3:34 am

Re: Help with executing a Jar file in PHP

Post by HNH992 »

They told they doesn't support JSP.
Does that code need JSP?
Post Reply