PHP Path issue running backticks/exec()

Posted by Lee on Stack Overflow See other posts from Stack Overflow or by Lee
Published on 2010-04-15T12:26:55Z Indexed on 2010/04/15 12:33 UTC
Read the original article Hit count: 240

Filed under:
|
|

Hey all

I'm trying to run a java jar file from the command line and within the the execution it gives a path. Withing this path their are spaces and this is causing the issue.

ie

$f = `java -jar /OCR/ocr.jar /Folder/Sub Folder/filetoocr.pdf /ocr/output.txt`;
echo "<pre>$output</pre>";

If you can see the space in between the Sub Folder name causes the issue.

By command line it would be (which works)

java -jar /OCR/ocr.jar /Folder/Sub\ Folder/filetoocr.pdf /ocr/output.txt

any suggestions how I can resolve this ??

Hope you can advise

© Stack Overflow or respective owner

Related posts about php

Related posts about mac