setting file sudoer di ubuntu supaya apche bisa mengeksekusi file, atau dengan kata lain script php bisa mengeksekusi binary
1. sudo su , masukan passwordnya
2. gedit /etc/sudoer
3. tambahkan di baris terahir sintak berikut
www-data ALL=(ALL) NOPASSWD:ALL
berikut contoh eksekusi lire dari script php :
<?php
$format_output =”xml”;
$format_type =”syslog”;
$source_file =”/var/log/syslog”;
$destination_file =”/home/”;
$sintak=”sudo lr_log2report –output “.$format_output.” “.$format_type.” “.$source_file.” “.$destination_file.” “;
$perl_out = shell_exec($sintak);
?>






No Comments Yet