sonnyboy Posted April 14, 2008 Share Posted April 14, 2008 <?php require_once('../classes/dbconnect.class.php'); require_once('../classes/myUsefulFunctions.class.php'); $myUsefulFunction = new account_types(); $permissionsArray = $myUsefulFunction->account_type($_SESSION['user_id']); $path = '/var/www/html/clients/conde_nast/html/'; if (!$handle = opendir('/var/www/html/clients/conde_nast/html/')) { mail('[email protected]','FAILED CRONSCRIPT-'.$_SERVER['SCRIPT_FILENAME'],'The filename contained in the subject field above failed, please address'); } while (false !== ($file = readdir($handle))) { if (!preg_match('/gallery/',$file)) { continue; } $mtime .= shell_exec('stat -c %y '. escapeshellarg($path.$file)); echo 'mtime'.$mtime.'</br>'; } ?>The script highlighted green ABOVE is where i need your assistance, basically trying to exectute stat bash command on server and return the value to $mtime in php, but mtime is alsways empty! could this be a pathing issue? HELP! Link to comment https://forums.phpfreaks.com/topic/101036-executing-bash-perl-script-via-php-exec-or-shell_exec/ Share on other sites More sharing options...
trq Posted April 14, 2008 Share Posted April 14, 2008 Always safest to use the full paths to your executables. Try /bin/stat Link to comment https://forums.phpfreaks.com/topic/101036-executing-bash-perl-script-via-php-exec-or-shell_exec/#findComment-516648 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.