How to Set Up a PHP/MySQL Site in Dreamweaver

  1. Home
  2. Knowledge Base
  3. Dreamweaver
  4. How to Set Up a PHP/MySQL Site in Dreamweaver

How to Set Up a PHP/MySQL Site in Dreamweaver

1 of 5

Set up a New Site in Dreamweaver

Yes, I want to use server technology. Photo Credit: Screen shot by J Kyrnin

If you are using Dreamweaver CS3 or Dreamweaver 8, you can start the New Site wizard right from the “Site” menu.

Name your site, and put in it’s URL. But at Step 3, choose “Yes, I want to use a server technology”. And choose PHP MySQL as your server technology.

2 of 5

How Will You Test Your Files?

 The most difficult part of working with dynamic, database-driven sites is testing. In order to make sure that your site is working correctly, you need to have a way to do both the design of the site and manage the dynamic content that comes from the database. It doesn’t do you a lot of good if you build a beautiful product page that won’t connect to the database to get the product information.

Dreamweaver gives you three ways to set up your testing environment:

  • Edit and test locally
    To do this, you need to have a functional Web server with PHP and MySQL installed on your desktop. If you have Windows, you can use a package to install WAMP (Windows Apache, MySQL, and PHP) and there are also packages to install on Macintosh computers as well. This is the best choice to get immediate feedback on what you’re editing.
  • Edit locally, then upload to a remote testing server
    If you’re working with other designers, then chances are you’ll need to choose this option. When you need to check something dynamic on your site, you upload the pages to the testing server. You can also use the check-in and check-out features in Dreamweaver to keep from overwriting your co-workers’ work.
  • Edit directly on a remote testing server using local network
    If your desktop is networked to the Web server, you can use this option to connect to the server.

I prefer to edit and test locally – it’s faster and lets me get more work done before pushing the files live.

So, I will be storing the files for this site inside the DocumentRoot of my Apache Web server.

3 of 5

What is Your Testing Server URL

Because I’ll be testing my site on my local computer, I need to tell Dreamweaver what the URL is to that site. This is different from the final location of your files – it is the URL of your desktop. http://localhost/ should work correctly – but be sure to test the URL before you click Next.

If you are placing your site in a folder on your Web server (rather than right at the root), you should use the same folder name on your local server as on the live server.

For example, I’m placing my site in the “myDynamicSite” directory on my Web server, so I will use the same directory name on my local machine:

4 of 5

Dreamweaver will also post your files live

Once you’ve defined your site location, Dreamweaver will ask you if you will be posting the contents to another machine. Unless your desktop also doubles as your Web server, you will need to choose “Yes, I want to use a remote server”. Then you’ll be asked to set up the connection to that remote server. Dreamweaver can connect to remote servers by FTP, local network, WebDAV, RDS, and Microsoft Visual SourceSafe.

To connect by FTP, you need to know the following:

  • Hostname or FTP address
  • Folder on the server to store the files
  • FTP login username
  • FTP login password
  • Whether you should use Secure FTP or not

Contact your hosting provider if you don’t know what this information is for your host.

Be sure to test your connection to make sure Dreamweaver can connect to the remote host. Otherwise, you won’t be able to put your pages live. Also, if you’re putting up a site in a new folder, make sure that that folder exists on your Web host.

Dreamweaver offers check-in and check-out functionality. I don’t use this unless I’m working on a project with a Web team.

5 of 5

You Have Defined a Dynamic Site in Dreamweaver

Review the settings in the Site Definition Summary, and if they are all correct, click Done. Dreamweaver will then create your new site.
Facebook Comments

Was this article helpful?

Related Articles