ubuntu - Shell Exec Jar Php -


i'm trying execute jar in php line

shell_exec("java -jar ocr.jar 2.jpeg /opt/lampp/htdocs/output/");

in terminal jar works in php not.

how fix ?

try calling

which java 

in ubuntu console, give

/usr/bin/java 

so use full path

also suggest calling exec($command, $output) , print output array more info. redirect stderr stream stdout end command 2>&1 , e.g.

 /usr/bin/java -jar ocr.jar 2.jpeg /opt/lampp/htdocs/output/ 2>&1 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -