Hi to all again,
I have again another trouble with using exec in php
my os is suse linux and I am using php 5.1.2
Somehow my output is being trimmed when i use exec()
in linux
~ -> ps -ef | grep java
root 3548 1 0 Aug05 ? 00:00:01 /usr/java/jdk1.5.0_13//bin/java -server -Djava.awt.headless=true -Xms512m -Xmx512m -XX:NewSize=224m -XX:MaxNewSize=256m -XX:SurvivorRatio=8 -XX:+UseParallelGC -jar /jfe-server.jar start
psinl 14811 1 0 09:12 ? 00:00:01 /usr/java/jdk1.5.0_13//bin/java -server -Djava.awt.headless=true -Xms512m -Xmx512m -XX:NewSize=224m -XX:MaxNewSize=256m -XX:SurvivorRatio=8 -XX:+UseParallelGC -jar jfe-server.jar start
psinl 18164 18080 0 16:20 pts/1 00:00:00 grep java
but when output to web via
<div>Checking whether JFEServer has been started</div>
<div><pre><?php exec('ps -ef | grep java',$output,$result);
print_r($output); ?></pre>
</div>
</br>
And my output on the web
Checking whether JFEServer has been started
Array
(
[0] => root 3548 1 0 Aug05 ? 00:00:01 /usr/java/jdk1.5.0_13//bin/java
[1] => psinl 14811 1 0 09:13 ? 00:00:01 /usr/java/jdk1.5.0_13//bin/java
[2] => psinl 18069 14271 0 16:20 ? 00:00:00 sh -c ps -ef | grep java
[3] => psinl 18071 18069 0 16:20 ? 00:00:00 grep java
)
Why is that php has automatically trimmed off my output even I didnt want it to?