exec - PHP shell_exec() - having problems running command -


im new php shell commands please bear me. trying run shell_exec() command on server. trying below php code:

$output = shell_exec('tesseract picture.tif text_file -l eng'); echo "done"; 

i have picture.tif in same directory php file. in shell can run without problem.

it takes while run code, doesnt make text_file when run in command prompt.

per comment:

should write loop in shell instead?

you can write simple shell script run command in loop. create script file first:

touch myscript.sh 

make script executable:

chmod 700 myscript.sh 

then open text editor such vim , add this:

for ((  = 0 ;  <= 5;  i++  ))   tesseract picture.tif text_file -l eng done 

thats basics of (not sure else need), syntax should started. run script, if you're in same directory script:

./myscript.sh 

or specify full path run anywhere:

/path/to/mydir/myscript.sh 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -