Is it possible to run php exec through cygwin?
Posted
by Scarface
on Stack Overflow
See other posts from Stack Overflow
or by Scarface
Published on 2010-06-15T01:20:58Z
Indexed on
2010/06/15
1:22 UTC
Read the original article
Hit count: 202
Hey guys I have one command that works on my remote linux server but not my windows (WAMP package) local server. I really want to create an identical workstation so I can test locally and then update my remote server. If anyone has any suggestions or solutions other than converting to linux, I would really appreciate it.
<?php
$safe_path = escapeshellarg('fake-virus.txt');
$command = '/usr/bin/clamscan --stdout ' . $safe_path;
$out = '';
$int = -1;
exec($command, $out, $int);
echo $int;
if ($int == 0) {
// all good;
} else {
echo 'o no';// VIRUS!;
}
?>
© Stack Overflow or respective owner