Search code examples
phplinuxcygwinwamp

Is it possible to run php exec through cygwin?


Hey guys I have one php exec 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!;

}





?>

Solution

  • I really want to create an identical workstation so I can test locally and then update my remote server

    Installing cygwin is the wrong way to go about this. Just use virtualbox, which you can get from here, and run an Ubuntu VM. Much easier (and nicer).