Monday 9 July 2012

Synology php exec


nano both file,
/usr/syno/etc/php.ini
/usr/syno/etc/php/user-setting.ini
modify,
safe_mode_exec_dir = /usr/syno/bin
to
safe_mode_exec_dir =  

then, restart apache
/usr/syno/etc/rc.d/S97apache-user.sh restart



`commandline` & shell_exec() will not work, use exec,

print `curl --help 2>&1` . "\n";
$output = shell_exec('curl --help 2>&1');
echo "$output";





use exec then print the stdout,

$output = array();
exec('curl --help', $output);
var_dump($output);
echo "\n";

foreach( $output as $line )
    print $line . PHP_EOL ;





No comments:

Labels

Search This Blog