Dreamweaver can't preview PHP files

Avatar
  • Answered
Within dreamweaver, there is a button "Live" to be able to see the website live on your Computer as you adjust the code.

For most page I have no problem, however it does not like PHP pages. I get the following error:

"Dynamically-related files could not be resolved because the site definition is not correct for this server"

Any thoughts?
Avatar
JacobIMH
Hello hunterharmony, and thanks for your question! When you're using the "Live" button within DreamWeaver to preview your website, this is essentially the same as opening up your web-browser, and then navigating to the HTML files located locally on your hard drive. This works perfectly fine, because your web-browser is capable of rendering out HTML and CSS for styling the pages, so you see just what you'd see if you published these pages to your website. However PHP is a dynamic server-side scripting language, meaning that first the code contained within the PHP script must be run on the server and processed, and then the resulting HTML code is displayed to your web-browser. If you'd like to use this preview functionality of DreamWeaver with your PHP scripts your only option would be to install a web-server on your own local machine, so that it can process the server-side PHP code for you. Adobe actually has a really in-depth write up on setting up a PHP development environment for DreamWeaver that goes over installing a PHP-enabled web-server to your local computer, and defining a PHP site in DreamWeaver. Of course your other alternative would be to simply upload your PHP scripts to your account with us, and then viewing them over the web from your website. Depending on how much updating of your scripts you intend to do, this could become very cumbersome, and is why a lot of PHP developers do go ahead and setup a local development environment to test on. If you had any other questions at all, please let us know! - Jacob