Copy link to clipboard
Copied
For a while I have had a php file that will not render in Live view. I have discovered that if I simply resave that file to a new file name it works perfectly. It is a very simple file which I will attach. However if I then save the new working version to the old file name it still won't work with that old file name. Just will not render it live view. Still works in Preview in a browser just fine so XAMPP and localhost are setup correctly. It's like Dreamweaver has saved that file name somewhere and it is corrupt. I have cleared the WinFileCache in the configuration folder but the problem persists.
Windows 11
Dreamweaver CC 2021
Anybody seen ths problem?
Copy link to clipboard
Copied
Is your Testing Server launched and are all PHP processes running on the server as expected?
Is your PHP file saved to your local testing server's default web directory -- on Xampp, that's the htdocs folder.
Are you being prompted by DW to Discover dynamically related files? See screenshot.
Results of test.php opened from local testing server in Live view.
Copy link to clipboard
Copied
Yes testing server launced and all processes running as expected. Yes saved in the site folder locaed in the htdocs folder. Yes prompted to discover dynamically related files by both the new file that works and the file saved with the old file name that does not work.
So I had a file named test111.php that would not show in Live View. I saved it to test111A.php and it worked perfectly in live view. I erased test111.php in the file panel. Then I saved the new and working test111A.php as test111.php (the old original file name) and that new file saved with the old name would not render in Live mode. No other settings were changed.
Copy link to clipboard
Copied
Actually I just noticed that the file that does not work is NOT prompting to discover dynamically related files! Why?
Copy link to clipboard
Copied
To run scripts, the file must be saved with a .php extension.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PHP Test</title>
</head>
<body>
<h1>My First PHP Page</h1>
<?php
echo "Hello World!<br>";
echo "Hello World!<br>";
echo "Hello World!<br>";
?>
</body>
</html>
Does this work?
Copy link to clipboard
Copied
Yes of course it works. However if I then save it as the one file name of "test111.php" it will not work with that one particular file name. Please read the thread carefully....I have been using Dreamweaver and creating websites for 14 years and have run across this a couple times before. Strangely if I copy that file to another site it renders prperly so there is some sort of file memory associated with the original site that prevents it from working there with that one file name.
Copy link to clipboard
Copied
I have a couple thoughts...
1. Out of curiosity, what happens if you change the file name at the OS level, instead of within DW (or were you doing that already)?
2. Since it works in another site, I wonder if turning off your site cache might help...
Go to Site > Manage Sites > click your "broken" site > Edit (pencil icon) > Advanced Settings > Local Info > uncheck Enable Cache > Save
Restart DW
Copy link to clipboard
Copied
Yes I already had turned off Cache for that site. Then I also remoced the site cache memory in the configuration file just be sure. No change.
I tried you suggestion about copying the file at dos level but no change in the problem.
Good suggestions...thanks for the help. Quite the puzzle!
Copy link to clipboard
Copied
Only one file in one site is corrupted?
Copy link to clipboard
Copied
No I think there are several but just focusing on this one to start.
Copy link to clipboard
Copied
Your site definition is probably corrupted.
Site > New Site... Create a new one and delete the old.
Copy link to clipboard
Copied
Yep did that. No change. Tried creating new site using old htdocs folder. Did not work. Copied files from old htdocs folder and created site referencing that. Still does not work. At one point I unloaded Dreamweaver altogether and reloaded it and that didn't fix it either. I think I need a Voodoo curse lifted!