php没有显示控制台的所有输出

时间:2013-06-07 08:51:18

标签: php apache console-application

我从php调用exe。 exe需要大约12-15秒才能执行。我正在显示其输出以检查它是否正常工作。似乎输出只是第一行。我对另一个工作正常的工作做了完全相同的事情。我不知道问题在哪里。从控制台运行时的exe显示所有输出。但是在第一行之后显示输出有延迟。这可能导致终止。我在控制台中获得的输出是

All warnings have the state 'off'.
%There is around 5 sec delay after this statement

Input Image Coarse labels
brown
red
white
Input Image Fine labels
     3

medium carmine
white
rose taupe
handbags\Satchel\2249a1363696156.jpg
brown
red
gray
     3

medium carmine
rose taupe
seashell
handbags\Hobos\5e7d81363672105.jpg
brown
red
white
     3

medium carmine
white
auburn
handbags\Satchel\598551363671893.jpg
brown
red
pink
     3

medium carmine
auburn
linen
handbags\Shoulder Bags\199291363674661.jpg
brown
red
black
     3

medium carmine
caput mortuum
pale chestnut
handbags\Shoulder Bags\d0f571363669974.jpg
brown
red
white
     3

medium carmine
white
rose taupe
handbags\Wallets\621de1363696385.jpg
brown
red
pink
     3

medium carmine
chestnut
khaki
handbags\Cross Body\b06731363673898.jpg
brown
gray
white
     3

rose taupe
misty rose
medium carmine
handbags\Backpacks\7beee1363672636.jpg
brown
red
pink
     3

medium carmine
caput mortuum
copper rose
handbags\Clutches\f7b7d1363673095.jpg
brown
red
pink
     3

medium carmine
caput mortuum
puce
handbags\Cross Body\e6e551363672712.jpg
brown
red
pink
     3

medium carmine
burnt umber
copper rose
Elapsed time is 6.855536 seconds.

我在php中获得的输出是:

Array ( [0] => Warning: No display specified. You will not be able to display graphics on the screen. [1] => All warnings have the state 'off'. )

忽略警告。我认为exe正在运行,否则将不会显示“所有警告已关闭状态”。任何解决这个问题的方法???我正在使用Linux OS我使用make文件来编译C ++ exe。

我在php中的代码是:

$addr="/home/fashion/fashion_shoe/shoesfinal $image $cwt $fwt $swt $twt";
exec($addr,$data);
print_r($data);

1 个答案:

答案 0 :(得分:0)

尝试

$data = shell_exec($addr);