close ad
 
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

Set up a test server on Windows

Tutorial created by Ray Borduin, WebAssist

Categories: MySQL, PHP

rating

Setting up a PHP/MySQL testing server on your own computer is an invaluable time saver for web developers. Once set up and functioning properly, you can develop, test, and prep your dynamic sites without having to upload to your live server every time you make a change.

This tutorial shows you how to set up your Windows machine to run a PHP/MySQL testing environment that you can use for testing PHP pages.

arrow downIf you are on Mac OS...

If you are a Mac OS X user and want to set up a testing server view the tutorial for Installing MAMP on OS X.

arrow downWhat you need to start

  1. Windows XP, Vista, or 7
  2. XAMPP for Windows (Basic EXE package installer) http://www.apachefriends.org/en/xampp-windows.html

arrow downDo I need a Testing Server?

In most cases, having a local testing server will save you time and make developing your dynamic website easier. However, depending on the extent to which a customer is developing websites, this may not be necessary.

Step 1: You might not need a PHP testing server if...

...you are not creating/modifying PHP pages.
...you are using a WebAssist Solution Pack and have no intention of customizing the code or functionality.
In this case, you should upload the Solution Pack directly to your server after modifying the necessary configuration files.

...you are using a product that creates PHP pages but you don't need to test until you upload to your live server.

Step 2: You definitely want a PHP testing server if...

...you are using eCart, DataAssist, or SecurityAssist to create a dynamic application. This will significantly speed up your development process.

arrow downTurn off IIS

IMPORTANT! IIS comes standard on many Windows computers, and will definitely be running if you've ever enabled (or attempted to enable) a testing server on your Windows machine using IIS. Even if you didn't turn it on, let's make sure it's off to avoid conflicts.

For Windows XP and Vista

  1. Open your Windows Control Panel from the Start menu.
  2. Choose Administrative Tools.
  3. Double-click the Internet Information Services (IIS) Manager option.
    If you do not see an IIS option, you probably do not have IIS installed. Skip this test and proceed with Installing XAMPP.

  4. From the Actions panel on the right, choose Stop.


For Windows 7

  1. Open your Windows Control Panel from the Start menu.
  2. Click Add/Remove Programs.
  3. Click Turn Windows features on or off.
  4. Uncheck the Internet Information Services (IIS) modules and click OK.
If you intend to use IIS for testing ASP or ASP.NET pages, you will need to stop your XAMPP service, before restarting IIS.

arrow downInstall XAMPP

XAMPP installs everything you need to run PHP pages and a MySQL database on your local machine.

  1. Double-click the Installer (.exe) file you downloaded from the XAMPP website.
  2. The XAMPP installer asks you to specify the directory to install XAMPP. It is recommended you leave the default setting specified.
  3. The remainder of this tutorial assumes that you selected the default option which installs XAMPP to C:\xampp.
  4. Click Install.


    The Installation process can take up to a few minutes. Once complete, a Command Prompt window will display for you to configure a few additional settings.

  5. The Command Prompt dialog will ask you some questions that you can answer by choosing 'y' or 'n' on your keyboard.
  6. You should answer each question using the default answer provided. The following outlines each question, and the answer you should give.

    1. Should I add shortcuts to the startmenu/desktop?
    2. Enter 'y' then Enter to add these shortcuts, otherwise hit the 'n' key on your keyboard, then hit Enter.
    3. Should I locate the XAMPP paths correctly? Should I proceed?
    4. Enter 'y' and then the Enter key.
    5. Should I make a portable XAMPP without drive letters?
    6. Enter 'n' and then the Enter key.
    7. XAMPP is ready to use.
    8. Hit the Enter key.
    9. I have set the timezone to...
    10. Hit the Enter key.


  7. Once you have answered all these questions, the following message will display.

  8. First, enter 5 to enable IPv4 only.
  9. Lastly, enter 1 and hit Enter to open the XAMPP Control Panel.

arrow downStart your Server

Once installed, you can use the XAMPP Control Panel to start your testing server.

  1. Click Start next to both Apache and MySQL to start the services.
    Starting these services can take a few seconds. When it is complete, 'Running' will display beside each option.
To make your testing server start automatically when your computer starts, you can check the Svc checkbox beside both options.
If the XAMPP Control Panel is not already running, go to C:\xampp\control.exe to open the panel.

arrow downA little cleanup

With your testing server now installed and running, there are a few final steps you should take to make sure everything is configured to work perfectly.

  1. Open a web browser such as Firefox or Internet Explorer.
  2. In the Address bar, enter http://localhost.
    You should see a XAMPP splash screen with language options.
  3. Choose your preferred language.
    You should now see a confirmation window informing you that 'You have successfully installed XAMPP on your system'. This interface allows you to configure certain XAMPP settings.

Step 1: Security Settings

Best practices encourage you to always have a password specified for your MySQL database, and we think you should too.

  1. From the side navigation, choose Security.

  2. Click the link shown in the graphic below.

    The next page displays the login credentials for your MySQL database. The username (SuperUser), 'root' is created for you automatically and is the username you can use for accessing your MySQL database or creating a database connection.
  3. In the new password field, enter a password for accessing your database.
  4. Enter the password again in the second text field.
  5. Choose Password Changing to confirm your new password.


You've now determined the username and password that you will use every time you need to access your database, or create a database connection in Dreamweaver.

Each time you change your password, you will need to restart your testing server for the change to take effect. Access the Control Panel by double-clicking the XAMPP icon in your taskbar. Choose Stop and then Start beside the MySQL option to restart the database.

Step 2: Test the PHP Installation

Lastly, you should test your PHP Installation to make sure everything is set up for you to load PHP pages on your local computer.

  1. Navigate back to the http://localhost page you were at before.
  2. Click the phpinfo() option from the side navigation.


If you see a PHP page similar to this, you have completed setting up your PHP/MySQL testing server.

arrow downWhat to do next...

Now that your testing server is completely set up, you can preview your PHP pages on your local computer. In order for this to work, you need to store your website's files in C:\xampp\htdocs.

If you chose to install XAMPP to a different directory, this path will be different.



Now, you should define a site in Dreamweaver that utilizes your testing server. This will allow you to preview any PHP pages that you are developing without uploading them to your live server.

arrow downReviews and comments

Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.

Sign in to add comments
rating

Brendan: 10 Years, 8 Months, 4 Weeks, 2 Days, 19 Hours, 29 Minutes ago

If i have a site that i have already built without the local test server, how do i begin to use the local test server for future developement/changes/additions?

rating

Anna Robinson: 10 Years, 9 Months, 2 Weeks, 3 Days, 19 Hours, 43 Minutes ago

Just follow this tutorial to get your local test server set up. If you don't have your site locally at all, you can FTP it down and then define your local and remote servers in Dreamweaver. If you need further details, click help in our main menu so technical support can assist you with the back & forth in a timely manner. :)

Brendan: 10 Years, 9 Months, 1 Week, 12 Hours, 58 Minutes ago

This tutorial outlines the install process, which I have found 100s of times online. Is there a follow up that might show someone (me and other novice programmers) how to setup a virtual directory (so that we can continue to store our site files in the directory where we save sites), and then how to export the local database to our live server?

Also, maybe what Brian asked was how to bring the live database down to the local test server so that you can test changes and new features without being on the live site?

rating

Team WebAssist: 10 Years, 9 Months, 6 Days, 18 Hours, 36 Minutes ago

For testing server configuration questions like creating virtual directories, try http://community.apachefriends.org/f/

Tech support also recommended this one: http://w3shaman.com/article/creating-virtual-directory-apache

For transferring database updates up and down (local to remote), you can import and export a sql file through phpMyAdmin. Here is one tutorial we have on this:
http://www.webassist.com/tutorials/Import-a-sql-file

: 10 Years, 2 Months, 1 Week, 3 Days, 20 Hours, 53 Minutes ago

Where you stated above to turn off the iss modules (I copy and pasted your directions below) after the directions please read my comment.
Your directions
Open your Windows Control Panel from the Start menu.
Click Add/Remove Programs.
Click Turn Windows features on or off, located in the left-hand pane.
Uncheck the ISS modules and click OK.

My comment...
I followed this for windows 7 and apparently it is not top left but middle top of screen for turn windows features on or off
Then where you say uncheck ISS modules, well, there aren't any so for a noob like me I would be entirely lost right here...which I was.
I considered that maybe you made a typo and meant IIS modules, so I unchecked those.
I hope I don't mess up my computer or am shutting off something I was not supposed to.
So with this said maybe it's a good idea to tell people exactly what ISS stands for? like "Internet Service Something or other" it is important to be very clear in instructions or there are going to be very frustrated people who just spent $799 dollars and wondering if it was worth it....Obviously after $799 one gets a little scared to want to go and spend another $99 for tech support based on poor explanations. Food for thought!

rating

Team WebAssist: 10 Years, 2 Months, 1 Week, 19 Hours, 9 Minutes ago

Thank you for your feedback. It looks like the acronym is spelled out in the Windows XP section, but not Windows 7, so we can fix that. Our tech support is free though, just so you know. Click on help in the main menu anytime!

: 6 Years, 9 Months, 3 Days, 2 Hours, 42 Minutes ago

Instead of Windows based platform, I would recommend setting up PHP site on a Linux based platform. Linux more stable and secure than Windows. If you don't know how to setup a website on Linux based server, then you can use Cloudways platform (https://www.cloudways.com/en/php-cloud-hosting.php ). This platform lets you launch a Linux Debian based server on an infrastructure in one-click. The server will have OS, stack and PHP already installed.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.