Web Applications

How do I get the absolute path to the public_html folder in PHP?

The absolute path is the directory location on a server’s hard drive to your public_html folder (cPanel).

To find out what your absolute path is. Add the following lines of code to a PHP file. Save and publish the file to your web space.

<?php 
  $path = getcwd();
  echo "Your Absoluthe Path is: "; echo $path; 
?>

Source: How to find your absolute path – Joomla

Was this guide helpful?

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London