在我的本地机器中,我使用了exec命令,如下所示: p>
< code> if($ serverHost ==“api.frapi”) { $ phpBianryPath ='/ Applications / MAMP / bin / php / php5.4.10 / bin / php'; } else { $ phpBianryPath ='/ usr / bin / php'; } $ logDir = dirname(__ FILE__)。 '/ BackgroundTask'; exec(“$ phpBianryPath $ logDir / notificationCall.php $ token&gt;&gt; $ logDir / log_file.log 2&gt;&amp; 1&amp;”); code> pre> < p>它在我的本地机器上运行完美。但是当我在生产服务器上上传然后尝试使用它时,它会出现如下错误: p>sh:/ var / www / html / example / src / frapi / custom / Action / BackgroundTask / log_file.log: Permission denied code> pre>
请指导我这个。我不知道 明白为什么它不能在生产中工作? p> div>