一、dirname(__FILE__)

比如:a.php所在路径为/var/www/web/a.php

dirname(__FILE__)返回的则是/var/www/web/

二、__DIR__

a.php中使用__DIR__获取的值就是/var/www/web/