Ben bir üretim sunucusuna php 5.2.9 kullanıyorum, ve exec () fonksiyonu "standart dışı" davrandığını görünüyor.
If i run exec("ls", $output, $return_var) then $output will contain the list of files in the current folder as expected, but $return_var will be set to -1 instead of 0, as expected.
I'm using the $return_var to determine wherever the command finished successfully, and on every other server tested this works as expected:)
Hiç kimse böyle bir durum vurdu?
edit:
<?php
$command = "asd";
$t1 = time();
$output = Array();
$result = -5;
$r = exec($command, $output, $result);
$t2 = time();
echo "<pre>";
var_export(Array(
'command'=>$command,
'result'=>$result,
'output'=>implode("\n", $output),
'r'=>$r,
't2-t1'=>$t2-$t1,
));
echo "</pre>";
I koymak ne olursa olsun komut $command, $result her zaman -1 olacaktır, hatta varolmayan komutlar için ... Bu çok garip