一、dirname(__file__)

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

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

二、__dir__

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