ShivaGupta Posted July 10, 2013 Share Posted July 10, 2013 (edited) <?php $card_image="test.jpg"; $cmd="curl -F userfile=$card_image \ -F outputencoding=\"utf-8\" \ -F outputformat=\"txt\" \ http://example.com/cgi-bin/weocr/ocr_scene.cgi >result.txt"; exec($cmd, $result); echo $result[0]; ?> Edited July 10, 2013 by ShivaGupta Quote Link to comment https://forums.phpfreaks.com/topic/280044-exec-not-returns-output/ Share on other sites More sharing options...
Solution kicken Posted July 10, 2013 Solution Share Posted July 10, 2013 You're redirecting your output to result.txt. There's no output for exec() to capture and return as a result of that. $result = file_get_contents('result.txt'); to get your output, or stop redirecting it at all. Quote Link to comment https://forums.phpfreaks.com/topic/280044-exec-not-returns-output/#findComment-1440223 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.