Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我又一次忘记了 CLI 没有定义 $_SERVER['DOCUMENT_ROOT'] 。
在将由 cron 运行的 PHP 脚本中获取可移植/相对路径的最佳方法是什么?
你的意思是:
$thePath= dirname(__FILE__);