LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2011, 03:54 PM   #1
harchew
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Using PHP exec with java


Hi izzit possible to use a php exec function to trigger a jar file using -java method? Basically I have a php file(index.php) written with the following code :

$output = exec('cd /opt/lampp/htdocs/ImageEditorFilters/; /opt/lampp/bin/jre/bin/java CBSim "/opt/lampp/htdocs/ImageEditorFilters/orginal.png" 3 "/opt/lampp/htdocs/ImageEditorFilters/new.png"');

However when I run the index.php, it doesn't trigger action.
Instead when I run this code in the terminal, it works perfectly well.

So is there any configuration needed to perform such action?
Oh btw I'm using XAMPP in linux ubuntu and CBSim.jar to convert some images.

http://homepage.mac.com/lpetrich/Col...m.html#use_app
 
Old 02-18-2011, 10:53 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,788
Blog Entries: 1

Rep: Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340
Do you get any output in the logs? Errors perhaps?
 
Old 02-19-2011, 12:56 AM   #3
harchew
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
No. Return empty and no error shown. Just wondering izzit possible to exec java in php?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime.getRuntime().exec("cd") returns java.io.IOException, error 2 in java tatarin Programming 4 03-28-2008 08:42 PM
PHP / VideoLAN / Fedora Core Question - how can I get the PHP "exec" function to work gtrawoger Linux - Software 3 12-21-2005 07:51 AM
Help php exec, system function for compile javac or java antony_csf Programming 0 06-15-2004 02:45 AM
php exec devit Programming 4 04-08-2004 04:26 AM
PHP exec Spooky Programming 1 01-19-2004 09:34 AM


All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration