Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Dreamweaver Developer Center /

Setting up a local testing server in Dreamweaver CS5

by David Powers

David Powers
  • http://foundationphp.com/

Content

  • Do I need a local testing server?
  • Defining a local testing server in Dreamweaver CS5

Created

30 April 2010

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Dreamweaver CS5 file management site setup testing website

Requirements

User level

Beginning

Required products

  • Dreamweaver CS5 (Download trial)

When developing a website that uses a server-side language, such as ASP, ColdFusion, or PHP, a local testing server lets you see what the pages produced by your dynamic code will actually look like before you put it into production. Dreamweaver actually requires you to set up a testing server if you want to do any kind of previewing work with dynamic of pages. Although you can use your live server on the Internet for testing, it's generally not a good idea. First, even with a fast connection, the process is slower. Second, you always need to be connected to the Internet. And, most importantly, you risk exposing all your mistakes, potentially providing a malicious attacker with vital information about your setup. It's far more convenient and secure to set up a local testing server.

This article describes what a testing server is, and how the setup process has changed in Dreamweaver CS5. The basic principles are the same for all server-side languages supported by Dreamweaver. Links at the end of this article guide you to detailed instructions on how to install a local testing environment for the server-side technology of your choice.

If you already have a local testing server, and just want to know how to register the details in your site definition, skip to Defining a local testing server in Dreamweaver CS5.

Do I need a local testing server?

Not all websites need a local testing server. If your pages contain only static HTML, CSS, and JavaScript, you can test your pages directly in Live view or by pressing F12 (Windows) or Option+F12 (Mac) to preview them in a browser without the need for a testing server. The same applies to web pages that contain content that is played back in Flash Player, such as SWF or FLV files.

You need a testing server only if you're using a server-side technology, such as ASP, ColdFusion, or PHP. The server is needed to process the dynamic code and convert it into HTML output that can be displayed in Live view or in a browser. A testing server works just like an ordinary website. The only difference is that it's not on the open Internet—it's where you iron out all the wrinkles before a site or an individual page goes live.

Why can't I use my website for testing?

You can, but it's not recommended. Your remote server is the public face of your website. Even if you haven't launched your website yet, using your remote server for testing is rarely a good idea.

For security reasons, many live servers suppress error messages, making it difficult to troubleshoot errors. Also, unless you create a separate location (folder) for your experiments, you no longer have anywhere for testing once the site goes live. And things can go wrong when moving a page from the testing folder to its intended destination. Perhaps the biggest danger is forgetting whether you're working on a test page or the real one. If you're not careful, you end up destroying your website.

The time spent setting up a local testing server is well worth it in terms of efficiency and security. If you're serious about developing with a server-side technology, it's not an option, but a necessity.

So, how do I get a testing server?

Design studios and large organizations usually test their sites on dedicated machines called staging servers, which are accessed over a local network or over the Internet. However, for individual developers, this is rarely necessary. The simplest solution is to create a testing environment on your local computer by installing a web server (which processes web pages) and an application server (with the capability to process dynamic data so that it displays on a web page). You might also need to install and a database server.

To avoid any misunderstanding, these servers are not separate machines, but software that can be installed on any suitable computer. Which ones you need depends on your choice of server-side technology.

ASP uses Microsoft IIS, which is bundled with most versions of Windows, but not automatically installed. ColdFusion Application Server has its own web server, which can be integrated with an existing web server and database, but the simplest way is to use the embedded ColdFusion web server and database management system; for more information (and to downloads), see the ColdFusion Developer Center. PHP normally uses the Apache web server, but can also be installed in IIS. Apache and IIS are free. ColdFusion is a commercial product, but the developer version for testing purposes is free. You can also get free developer versions of the MySQL and Microsoft SQL Server databases.

For PHP/MySQL development, you can get all-in-one packages—again free—that install the necessary software in a single, simple operation. Among the most popular are XAMPP for Windows and MAMP for Mac OS X.

For testing purposes, none of the necessary software requires high-performance hardware. If you've got a local network, you can convert an old computer to act as your testing server. But unless you're short of disk space, it's probably much simpler to install the software for your chosen server-side technology on your main computer. Once installed, it runs in the background consuming virtually no resources.

How do I use a local testing server?

Once you have installed the necessary software, you just add a few details to your site definition in Dreamweaver (instructions are in the next section) so the server knows how to process the dynamic code in your pages before displaying them in Live view or previewing them in a browser. For the server to process the code, Dreamweaver needs to copy your files to the server's document root or to a subfolder inside the document root (although it's common practice to store your files there in the first place). The document root is the top-level folder where web pages and scripts are stored. On your remote server, it is often called public_html or www. In a local testing environment, it's usually called htdocs or wwwroot.

You also need to tell Dreamweaver the URL for your local testing server. If it's on the same computer, the address is normally http://localhost/.

After providing these details to the Dreamweaver site setup, Live view and Preview In Browser display pages that contain server-side code (that is, dynamic pages) in exactly the same way as static HTML files.

Defining a local testing server in Dreamweaver CS5

Changes to the site definition process in Dreamweaver CS5 are designed to get you up and running much more quickly by prompting you for information only when it's needed. If you have worked with previous versions of Dreamweaver, you should find the transition quite easy. The Basic and Advanced tabs are gone. There's now just a single dialog box.

Note: The following instructions outline the general principles of setting up a testing server. The accompanying screenshots were taken on a computer configured to use a nonstandard location (C:\htdocs) as the testing server document root. The location of your server’s document root is likely to be different. There are links at the end of this article to more detailed instructions specific to ASP, ColdFusion, and PHP.

Basic site definition

All you need to define a site in Dreamweaver CS5 is a name for the site and the folder where you intend to store the local files.

  1. Choose Site > New Site.
  2. Type a name for the site in the Site Name text box.
  3. Click the folder icon alongside the Local Site Folder text box to select the folder where you want to store your local version of the website.
  4. Click Save (see Figure 1).
A basic site definition requires just two pieces of information.
Figure 1. A basic site definition requires just two pieces of information.
  1. Click Done to close the Manage Sites dialog box. You're now ready to start working in your site.

Note: If the testing server is on your local computer, it's common to store the local files within the testing server's document root. This way, Dreamweaver does not have to copy the files to the testing server each time you test them.

Defining a testing server

The first time that you try to test a page that contains server-side code, either using Live view or by pressing F12/Option+F12 to preview in a browser, Dreamweaver displays an alert prompting you to specify a testing server (see Figure 2).

Dreamweaver reminds you to set up a server to test dynamic pages.
Figure 2. Dreamweaver reminds you to set up a server to test dynamic pages.

Follow these steps to define your testing server:

  1. Click Yes.
  2. In the Servers section of the Site Setup dialog box, click the plus button (see Figure 3) to add the testing server definition.
Click the plus button to add a new server definition.
Figure 3. Click the plus button to add a new server definition.
  1. This opens a new dialog box, where you define the server details. The same dialog box is used for both testing and remote servers. To set up a local testing server, select Local/Network from the Connect Using options.
The basic options for a local server connection
Figure 4. The basic options for a local server connection
  1. Type a name for the server in the Server Name text box (see Figure 4).

    Unlike previous versions, Dreamweaver CS5 lets you define multiple servers for a site. So, this identifies which server the definition belongs to.

  2. Click the folder icon to the right of the Server Folder text field, and navigate to the folder inside your testing server root where you plan to test the files.

    The Apache server root is normally called htdocs, although some all-in-one PHP packages (such as WampServer and EasyPHP) use www. ColdFusion and IIS both use wwwroot.

  3. Next, type the Web URL for your testing server.

    This is the URL you would need to enter in a browser to access your testing server. If you selected the testing server root as the value for Server Folder, the value of Web URL is normally http://localhost/. If you used a subfolder of the testing server root, and called it phptest, Web URL will normally be http://localhost/phptest/.

  4. Click the Advanced button (see Figure 5) at the top of the dialog box.

    This exposes options for both a remote server and a testing one. Since you are setting up a testing server, you can ignore the options in the top section.

  5. Select your server technology from the Server Model drop-down list.
Select the server technology for the testing server.
Figure 5. Select the server technology for the testing server.

Note: The Server Model list has options for seven server technologies that you can test within Dreamweaver. However, Dreamweaver CS5 no longer supports automatic code generation through server behaviors and recordsets in ASP JavaScript, ASP.NET C#, ASP.NET VB, or JSP.

  1. Click Save to return to the main Site Setup dialog box, where your testing server should now be listed.
  2. Make sure that the Testing check-box is selected (see Figure 6).
The checkbox confirms that the server is used for testing.
Figure 6. The checkbox confirms that the server is used for testing.

The four icons at the bottom left of the dialog box should now all be active. In addition to adding a new server, you can delete the currently selected server by clicking the minus icon. Click the pencil icon to edit the selected server. The final icon lets you duplicate a server definition. This is useful if most of the server details are the same. You can duplicate an existing definition, and then edit it.

  1. Click Save to close the Site Setup dialog box.

Dreamweaver informs you that it's updating the site cache. When that's done (usually a matter of a couple of seconds, unless you have a large site), Live view and Preview In Browser should work normally with files that contain server-side code.

Troubleshooting

Occasionally, things go wrong. The most common cause of problems with a local testing server is failure to enter the correct values for Server Folder and Web URL. These must both point to the same place:

  • Server Folder is the physical path to the site root inside the server's document root.
  • Web URL is the value you would enter into a browser address bar to get to the same place.

Figure 7 shows the relationship between the two values in a PHP page being displayed in Live view.

Live view uses a built-in browser to display dynamic pages.
Figure 7. Live view uses a built-in browser to display dynamic pages.

In this example, the server's document root is located at C:\htdocs. This is the equivalent of http://localhost/. In order to test more than one site in my local testing environment, I defined the Server Folder for the site as C:\htdocs\phptest. As a result, the value of Web URL needed to be http://localhost/phptest/ (see Figure 4).

Here are some other things to check if your server-side code fails to display correctly in Live view or Preview In Browser:

  • Is the local web server running?
  • Is a software firewall preventing communication between Dreamweaver and the web server? Try disabling the firewall temporarily to see if it makes any difference.
  • Choose View > Live View Options. Make sure the Use Testing Server For Document Source option is selected.

Where to go from here

Using a local testing server is the most efficient way of developing websites that use server-side code. It's faster, more secure, and the set up process in Dreamweaver CS5 has been streamlined to make it easier.

If you still haven't made up your mind about the right server-side technology for you, take a look at Which server-side technology should I choose?

The following articles offer help with setting up a testing environment for the server-side technology of your choice:

  • Setting up a ColdFusion development environment for Dreamweaver
  • Setting up a PHP development environment for Dreamweaver
  • Setting up an ASP.NET development environment for Dreamweaver

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

More Like This

  • Turning a design into HTML and CSS using the Fireworks to Dreamweaver workflow – Part 2: Modifying the HTML and CSS
  • Styling and inserting a Spry Menu Bar 2.0 widget with the Adobe Widget Browser
  • Getting started with the Adobe Test&Target Extension for Dreamweaver CS5
  • Turning a design into HTML and CSS using the Fireworks to Dreamweaver workflow – Part 1: Exporting the design
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 3: Using CSS media queries to target different screen resolutions
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 2: Styling the web page
  • Understanding Spry basics
  • Excerpt: Bring Your Web Design to Life
  • Using and customizing jQuery Mobile themes
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 1: Building the web page

Tutorials and samples

Tutorials

  • Understanding HTML5 semantics: Changed and absent elements
  • Mobile app with PhoneGap: Submitting to the Apple App Store
  • PhoneGap and Dreamweaver: Releasing on iOS
  • Mobile app with PhoneGap: Creating a release build for Android

Samples

  • Responsive design with jQuery marquee
  • Customizable starter design for jQuery Mobile
  • Customizable starter design for HTML5 video
  • Customizable starter design for multiscreen development

Dreamweaver user forum

More
04/23/2012 Resolution/Compatibility/liquid layout
04/20/2012 using local/testing server with cs5 inserting images look fine in the split screen but do not show
04/18/2012 Ap Div help
04/23/2012 Updating

Dreamweaver Cookbook

More
11/07/2011 Simple social networking share buttons
09/20/2011 Registration form that will generate email for registrant to validate
08/21/2011 Spry Accordion - Vertical Text - Auto Start on Page Load - Mouse Over Pause
08/17/2011 Using cfdump anywhere you like

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement