I want to run command via php, what I've tried
<?php
$out=exec("pwd")
echo $out
?>
Output: c//xampp/htdocscommands
Problem arised in this case
<?php
putenv('PATH=C:\xampp\htdocs\command\execute ');
$out=exec('pwd');
echo $out;
?>
Output: operable program or batch file.
Then I try to run even simple command exe("pwd"), I'm getting this error
operable program or batch file.
What I'm trying exactly is
- I need to run command via php exec or other syntex too
- I need to set the path right way
e.g.: exec("cd path some_command")