[php] 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.

This question is related to php macos eclipse-pdt

The answer is


For posterity

I never use PHP so I completely forgot where apache was installed on my mac as it was running on port 8080 mocking me, installed in a non-standard path. After giving up on the internet, I tried this...

httpd -t -D DUMP_INCLUDES

Because httpd was running it produced the httpd.config path and then the clouds parted and the sun shown brightly on my face. Victory! as within it lies the path to localhost.

ServerRoot "/your/path"

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

Applications -> XAMPP -> htdocs This is the place where you should put your files for the website you're building.


Actually in newer Osx os's, this is stored in /Library/WebServer/Documents/

The .en file is just an html file, but it needs special permissions to change, so I just made a folder for my stuff and then accessed it by user.local/Folder/file.html


There's no such thing as a "localhost" folder; the word "localhost" is an alias for your local computer. The document root for your apache server, by default, is "Sites" in your home directory.


open the 'Finder' in Mac and Command+Shift+G and type in the path:/usr/local/zend/apache2/htdocs. path will open then create/paste your web page/application then check it on the browser.


If you use apachectl to start or stop, then you can find it with this command

apachectl -t -D DUMP_RUN_CFG

Macintosh HD/Library/WebServer/Documents

Macintosh HD is the name of your HD

If you can't find it: Open Finder > click "Go" at the very top > Computer > Your HD should be there. You can drag and drop the HD to favorites on the left.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to macos

Problems with installation of Google App Engine SDK for php in OS X dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac Could not install packages due to an EnvironmentError: [Errno 13] How do I install Java on Mac OSX allowing version switching? Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Can't compile C program on a Mac after upgrade to Mojave You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) How can I install a previous version of Python 3 in macOS using homebrew? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'"

Examples related to eclipse-pdt

Where is localhost folder located in Mac or Mac OS X? The project description file (.project) for my project is missing How do I add FTP support to Eclipse?