Problem with exec line

liderbug

New member
Building a web page. I had originally had about 10 lines of PHP code to send a command to a Tp-Link EP10 mini plug. On, Off, Status. Then I ran across a case, HS103 which required different code. Both have stand alone, via command line programs, to operate. So for simplicity I went with exec ("/usr/local/bin/kasa $IP $CMD", $return); My problem is the original code ran fine but the exec code is acting like I've said "nohup exec(....); &" when I run in Apache, the page pops up without any time delay - or data. If I "php index.php > X.html" it runs correctly and when I display X.html - life is good.
 
And with that 30 minutes later after adding "2>&1" to the exec command - "permission denied" I had been running from $HOME/bin/kasa. Moved to /usr/local/bin ... and <sigh>
 
Back
Top