PHP beginners who started learning php confuse when to use dirname(__FILE__) in their php script.
So first of all learn what dirname(__FILE__) do.
so let's create a small php script
Output- /var/www/dev (output differs in your case as directory structure is different)
what does this script do it will print the path where your file save. It's very useful when you require a file.