Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is localhost folder located in Mac or Mac OS X?

I just started developing PHP projects on my mac (using PDT) and was wondering where localhost is located? How does Mac OS X serve websites, I haven't changed any settings during the installation of PDT.

like image 235
Tassisto Avatar asked Mar 19 '11 21:03

Tassisto


People also ask

Where is my localhost folder on Mac?

The Hosts file on a Mac is found in the /etc/hosts folder.

Where do I find my localhost folder?

There is no such thing as a localhost directory by default. You first have to install a web server, and then drop your files in the directory that is specified in the configuration.

Does Mac Have localhost?

Set up localhost on macOS You'll need to enable apachectl in Terminal to launch the requisite service for running localhost.

Where is Apache www folder in macOS?

Find httpd. By default, Apache is enabled and installed in /etc/apache2/ , inside httpd. conf file, find DocumentRoot to tell where is the default localhost folder.


2 Answers

There are actually two place where where mac os x serves website by default:

/Library/WebServer/Documents --> http://localhost

~/Sites --> http://localhost/~user/

like image 186
Chris Muench Avatar answered Sep 19 '22 02:09

Chris Muench


The default Apache root folder (localhost/) is /Library/WebServer/Documents

Also, make sure you have the PHP5 module loaded in /etc/apache2/httpd.conf

LoadModule php5_module libexec/apache2/libphp5.so 
like image 31
McKayla Avatar answered Sep 22 '22 02:09

McKayla