AMH 怎么指定www用户来运行php脚本。我现在运行脚本出错了。
amh amcrontab run_php lnmp01 php-8.3 /home/wwwroot/lnmp01/domain/test.com/web/app/bin/legacy -C cron
提示root用户不行。
[amcrontab-2.5 run_php]
=============================================================
[OK] amcrontab-2.5 is already installed.
[ERROR] Unable to run as root (run this command as a regular user)
=============================================================
[Linux] AMH 7.1
https://amh.sh
[amcrontab run_php]
=============================================================
=============================================================
[Linux] AMH 7.1
https://amh.sh
[amcrontab-2.5 run_php]
=============================================================
[OK] amcrontab-2.5 is already installed.
[ERROR] Unable to run as root (run this command as a regular user)
搞不了。
amh有安全限制非root用户是执行不了amh命令。
如果要用非root用户执行,建议用直接用php的命令,先在面板的『网站』环境列表勾选上命令行选项。(像上面的lnmp01、php-8.3的环境)
再用sudo指定www用户执行,如:
sudo -u www php /home/wwwroot/lnmp01/domain/test.com/web/app/bin/legacy -C cron