Forum HomeMembersRecent Posts Forums Q&A Forum PHP ecosystem PHP How to find root di... Notifications Clear all How to find root directory in PHP? Last Post RSS Elias(@elias) Illustrious Member Joined: 5 months ago Posts: 4277 Topic starter 27/10/2024 6:06 pm How to find root directory in PHP? Quote Elias(@elias) Illustrious Member Joined: 5 months ago Posts: 4277 Topic starter 27/10/2024 6:06 pm In order to get the root directory path, you can use _DIR_ or dirname(). echo dirname(__FILE__); Both the above syntaxes will return the same result. ReplyQuote Share: