How to setup a local webserver.

Posted in by Nazrul Islam . Filed in Tech guide


If you aimed to learn PHP programming or any PHP based CMS like WordPress, you will need a local server environment. This could be done with standalone installation of Apache, MySQL and PHP or get all these software in one package. There are several packaged fake server software available for Windows, Linux and Mac platform. We will cover WAMPSERVER for Windows and MAMP for Mac users. No problem which package you select they basically do the same job.

Setup a web server in Windows:

WAMPSERVER is one of the most popular fake server software for Windows available in 32 and 64 bit version. Its a free software and installation process is quite easy. Almost no configuration is required for a beginner. During writing this article Wampserver 2.5 is the latest stable release and packaged with Apache 2.4.9  with PHP 5.5.12 and MySQL 5.6.17. Don’t have it yet? download it from their official page.   Before start installing make sure that you have Microsoft Visual C++ Redistributable installed on your system. If not, download it from here and install it. So lets start the installation process. Double click on setup file to run installer, welcome screen looks similar to this.

wamp-installation

Click Next on welcome window in marked as 1 and check License agreement radio button then click Next spotted in mark 2 in the picture.

Set Installation path and click Next, If you need shortcut turn on these check box on mark 4 and click Next.

wamp-installation

Click on Install in confirmation window and installation process will taking place as shown in mark 6 in the picture.

wamp-installation4

A window marked 7 in the picture will asked you to select default browser, if you not sure just click open – internet explorer will be selected automatically. If you have any mail address on your own domain put it on marked 8.  It pointless to me because localhost can’t route mail, Click Next and window will show that setup is finished, Click Finish button. WAMP will start automatically if Lunch Wampserver checkbox was checked on mark 9.  If windows ask permission for port access just click Allow access. After a successful installation, You can find a green color WampServer icon in windows notification area marked 10 in picture. If Wamp icon doesn’t show green, there might be any problem occurred during installation, uninstall it from control panel and carefully follow these step again . Click on Wamp www directory to access you document root. All other option like as MySQL console and phpMyAdmin also available in this window. That’s all, your Wampserver is ready for development.

Setup a web server in MAC:

MAMP is an excellent choice for setting a local server environment in MAC. It offers both free and commercial version. Commercial version has some features like multiple server. Don’t worry free version works fine. In this article we’ll discover free version. Download MAMP form their official page. Run the installer pkg and follow these stepMAMP-Insatallation

Click Continue on first welcome screen then again continue to the next window spotted in mark 2 in the picture.MAMP-InsatallationClick Continue in license agreement page a popup window will ask for confirmation click agree. If you don’t have a plan for buying MAMP pro in future click Customize marked 4 in the picture.

web server macUnckeck WAMP Pro and click Install button installation will start copying file to system.

Fake server macClick close in final notification window and your MAMP is ready for development. If you wish to access MySQL from terminal then open terminal and make a MySQL alias to your local bin directory by typing sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql . Hope you enjoyed this lesson and setup your local web server.


0 comments