您的位置:首页 > 汽车 > 时评 > You can‘t run this command as root ( uid = 0 ).

You can‘t run this command as root ( uid = 0 ).

2024/10/19 17:24:51 来源:https://blog.csdn.net/qq_26450889/article/details/140793872  浏览:    关键词:You can‘t run this command as root ( uid = 0 ).

最新的系统使用了是否使用 root 运行 php artisan 命令的检测,如果是 root 用户运行会提示 You can't run this command as root ( uid = 0 ). 错误。

解决方法:

sudo -u www /xxx/bin/php /www/example.com/artisan xxx

其中,

  • www 为运行用户,通常为 www 或 www-data
    • 宝塔环境下,默认用户是 www
  • /xxx/bin/php 为 PHP 的运行路径
    • 宝塔环境下,通常为 /www/server/php/56/bin/php 或 /www/server/php/70/bin/php
  • /www/example.com/artisan 为 artisan 命令的路径
    • 宝塔环境下,通常为 /www/wwwroot/example.com/artisan

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com