linux - Crontab - sh: ip command not found -


I have a PHP script that can successfully get the results of this command.

  exec ("ip address list", $ result);  

If I use it on the command line by using

  / usr / bin / php /root/myscript.php  
Run

But when the CronantB runs it, then the result will not be a sh: ip command. I also tried

  exec ("/ sbin / ip addr list", $ result);  

But there is still no luck

Any help would be greatly appreciated.

Add a log to your cronjob to see dome som dow command 14 9 8 * / usr / bin / php

/ home / user / Test.php & gt; & Gt; /home/user/test.log2 & gt; & Amp; 1

The code was successfully executed with a chronobose;

  & lt ;? Php $ ret = Exec ("/ sbin / ip addr list", $ out, $ err); $ File = '/home/user/output.log'; File_put_contents ($ file, $ out); ? & Gt;  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -