Jump to content

executing bash perl script via php exec() or shell_exec()


sonnyboy

Recommended Posts

<?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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.