Bryan Comstock Web Creative » Creating your own Web Server on a Mac | Website Design & Development | Seattle, WA
 

Creating your own Web Server on a Mac

April 21, 2010

For the beginning php student it is frustrating to always have to upload your files to a server to test them. The solution is to set up and install a web server and PHP on your local computer. On a Mac OS X, the web server is already there, you just need to turn it on. In System Preferences select Sharing in Internet & Network.  Highlight Web Sharing and click Start to turn it on (or click the check mark next to Web Sharing if you are using a newer version of OS X). Make sure the site you are creating is in the Sites folder under your username. Then, you’ll need to type localhost/~yourusername/yoursite etc. in the URL to point your browser to your local site. For example to edit the local version of my website I type http://localhost/~bryancomstock/bcwebcreative/index.php. Of course, if you want to use PHP in your pages, you’ll also need to install PHP, and ultimately, MySQL, but those are easy, (and free) to install as well. I’ll save that for another post.

Comments are closed.