Copy link to clipboard
Copied
Another newbie here trying to use preview to view PHP files without success. Please help
I've literally spent months on and off trying to view a simple PHP file stored on /Applications/XAMPP/xamppfiles/htdocs/mysite
I always get an error message saying "Dynamically-related files cannot be discovered because there is no site definition for this document" Setup
I've viewed a number of Youtube videos and I'm really hopeful I've set up the testing server correctly.
-----
Site name: mysite
Local site folder: /Applications/XAMPP/xamppfiles/htdocs/mysite
----
Server name: mysite
Connect using: Local / Network
Server folder: /Applications/XAMPP/xamppfiles/htdocs/mysite
Web URL: http://localhost/mysite/
Set to Testing
------------
http://localhost/mysite/ works fine when I view on Safari or Chrome
I'm using Dreamweaver 21.1 XAMPP 8.1.2 on a MacBook Air M1 2020 running Monterey 12.2.1
I'm sure it's stupidly simple to fix, but I would really appreciate some advice.
Thanks
Simon
Copy link to clipboard
Copied
I moved your question to a new topic for you. The old topic to which you posted was unrelated to yours.
First define your local site & testing server by going to Site > Manage Sites and giving your site an identifiable name i.e. your_site. See screenshots below.
Your local site folder should reside in Applications\xampp\htdocs\your_site_folder\
Click on Servers in left panel and the plus sign to add new server.
Basic tab:
Advanced tab: The server model should be PHP/MySQL
Final screen.
For this to work, Xampp must be launched and all PHP/Apache processes must be running.
Hope that helps.
Copy link to clipboard
Copied
well Nancy demonstrates you how to set a local and testing server before doing anything using Xampp, but It seams that in your original post, you already describe that you have set it...
I haven't a Mac under hand... but I would say that you have a port trouble... probably be sure of the port use by Xampp first and check if there isn't any collision with an other app first... then if it is the case changing the xampp port could be a way to go...
to check the default port (80)
open in xampp > apache > conf > httpd.conf... line 60
Listen 80
change it to 8080
and check on localhost:8080
Copy link to clipboard
Copied
OP says they can access localhost directly via safari and chrome so it's more likely to be a set up issue in Dreamweaver than a port issue, my guess is they haven't correctly defined the site in DW, probably missed a step, so it's throwing a wobbly.
Copy link to clipboard
Copied
OP says they can access localhost directly via safari and chrome so it's more likely to be a set up issue in Dreamweaver than a port issue...
By @osgood_
=========
Yes. I agree. Most likely the Testing Server model was not specified PHP/MySQL.
That said, I do have some files that throw the dreaded, "Dynamically-related files could not be discovered..." message. That's because I have PHP include files that contain include statements. Nested includes confuse DW.
I just ignore the nag screen and go about my work. I know my code works which is all that matters.
Copy link to clipboard
Copied
Thank you all for kindly helping
You were correct that I did not have the testing server set to PHP/MySQL, but correcting that did not solve it.
So I started from scratch and set up a new check_php site on /Applications/XAMPP/xamppfiles/htdocs/check_php
Followed the steps Nancy noted and set up a new testing server ensuring I set it as a testing server set to PHP/
MySQL.
The warning has disappeared, but <?PHP echo date ('h:i:s') ; ?> still shows a PHP symbol on design and split view, but shows the time on http://localhost/check_php/
On the files tab in standard view I've tried changing from Testing Server > Local View > Remote Server, but it makes no difference.
Is there anything else I could try please?
Thanks again
Simon
Copy link to clipboard
Copied
Design View is a relic from a previous era, it is not a browser that makes requests to the server to translate server side code. To a limited extent, Live View will do that.
Copy link to clipboard
Copied
DESIGN view is for quick editing. LIVE view is for checking your layout. But neither view is as good as real browsers.
Right-click on open document tab and select Open in Browser.
That's the most reliable way to check your work and parse scripts locally.