Output: C:\xampp\htdocs\folder\subfolder\current_file.php Here, we have used the $_SERVER superglobal variable to get the path of the current executing script and then used the realpath function to get the absolute path. Package Library: Standard PHP Library (SPL)