从cron运行时,脚本的工作目录可能不同。另外,关于PHPs require()和include()的理解有些混乱,这引起了关于工作目录确实是问题的困惑:
include('foo.php') // searches for foo.php in the same directory as the current scriptinclude('./foo.php') // searches for foo.php in the current working directoryinclude('foo/bar.php') // searches for foo/bar.php, relative to the directory of the current scriptinclude('../bar.php') // searches for bar.php, in the parent directory of the current working directory
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)