16 Replies Latest reply: Mar 1, 2011 10:14 PM by mgason RSS

    Dynamically related files could not be resolved...WordPress Issues

    VKray Community Member

      I am so incredibly frustrated trying to get Dreamweaver CS5 to actually follow WordPress includes on a consistent basis. I'd even settle for semi-consistent if I could figure out how to get DW to cooperate 50% of the time. Briefly, after I first setup a Wordpress site with DW, DW functions as expected. I am able to see a correct list of all dynamic PHP includes. At times, one page can pull 50+ files and DW is able to follow and reveal all of the files but this behavior has absolutely no consistency... at least, I have not experienced any consistent behavior in how this feature functions. While DW never has any trouble finding JS, XML and CSS files that are hardcoded as includes on the first php file or linked in the HTML source, it has zero consistency in following all of the dynamic includes. I only want to see the files that are not obvious, as in the files that are included by other PHP includes. I would not have purchased CS5 if Adobe didn't claim to have seemless integration with WordPress.

       

      Am I doing something wrong? Once DW suddenly decides the site definition is not correct, I am unable to get the application to work with the same WordPress site again.Interestingly, if I delete the DW site and create a new one from scatch using the exact same structure and WP site, it will recognize the includes again for about an hour but that's it. I don't understand why it works briefly without failure but then suddenly decides that the definition that was created with DW's setup is suddenly invalid.

       

      Furthermore, I can't figure out how the "code hinting" actually works with WordPress. While the feature sounded great, I am beginning to think it's not functioning either. Is this Adobe's idea of "seemless WordPress 3.0 integration"? So far, DW CS5 has been nothing but a hassle. I've wasted the last two weeks just trying to get it to work. Unfortunately, I am designing a site for someone who refuses to use any other design tool because he bought CS5 Masters thinking it was "the" solution for building his WP site. The situation is so frustrating that I want to quit the project over his insistence on only using Dreamweaver. I can't even convince him to use FileZilla's FTP to upload content to the server because he only wants to use CS5 tools.  Of course, he is not coding the site and doesn't understand how/why I am having problems getting it to work with the Wordpress code.

       

      Ugh, I really apologize for whining. I am just so frustrated, and really hope I am overlooking something so I can focus on getting the site up and working with DW CS5. It can't really be this bad, can it? It must be me.

       

      Thanks in advance for any help you can provide.

        • 1. Re: Dynamically related files could not be resolved...WordPress Issues
          David_Powers CommunityMVP

          VKray wrote:

           

          Am I doing something wrong?

          Probably, but since you don't give any concrete information, it's impossible to say.

           

          First of all, your description of Dreamweaver suddenly deciding the site definition is not correct sounds odd. If you have set up the site definition correctly, and Dreamweaver is forgetting it, that sounds as though you have a corrupt installation or cache file. It might be necessary to delete the cache file or even your personal configuration folder. See the Dreamweaver FAQ for more information on those issues.

           

          The other problems might be due to misunderstanding how Dreamweaver CS5 works with WordPress and other CMSs. Dreamweaver uses your testing server to load WordPress pages in exactly the same way as a browser. In other words, everything is done through index.php in the site root. Open index.php, and launch Live View. To navigate to other pages, hold down Ctrl/Cmd, and click links in Live View to display them. As you navigate around the site, the relevant dynamically linked files should be added to or removed from the Related Files Toolbar. What dynamically linked files does NOT do is to discover every file. It discovers those that are linked at the current time.

           

          For code hinting to work, you need to select Site > Site Specific Code Hints. Dreamweaver should recognize it as a WordPress site, so all you need to do is to click OK. This inserts a file called dw_php_codehinting.config in your site root. This file instructs Dreamweaver to scan specific folders to generate the code hints for WordPress custom functions and classes. The scanning takes place in the background, so it usually takes a minute or so before code hints are fully initialized. It could take longer if you're low on memory or have a low spec machine.

          • 2. Re: Dynamically related files could not be resolved...WordPress Issues
            JoeyD1978 Community Member

            I've probably designed at least 100 sites by now using WordPress and Dreamweaver. I've never used anything other than "code-view" to edit the theme files. There might be over fifty files working to render a WordPress page as you're suggeting, but you'll never need to (or want to) edit any of the core WordPress files - only the ones in your theme. As for the ones in your theme, you really only need to worry about:

             

            • style.css
            • page.php
            • header.php
            • footer.php
            • index.php
            • search.php
            • 404.php

             

            Half of those are just variants of page.php, and there's others like author.php, tag.php etc that can probably be ignored too.

             

            My work flow is just to upload my modifications to a development version of the site (http://dev.example.com) and refresh my browser to see the changes. I don't know why anyone wastes their time with "Live View" in the first place. It's a goofy gimmick invented by the Adobe marketing team I'm sure. Just look at the page in a browser for pete's sake.

            • 3. Re: Dynamically related files could not be resolved...WordPress Issues
              VKray Community Member

              I think I may have figured out part of the problem but I don't know why it's happening.

               

              After a period of time, DW gets confused and starts duplicating paths. For example, if I highlight a path to an include, like this line:  /** Load WordPress dashboard API */ require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); I get an error that because DW is looking for:

              C:\inetpub\xampp\htdocs\blog\wp-admin\wp-admin\includes\dashboard.php

              The path is incorrect.

               

              It's duplicating the wp-admin folder and as a result, it can't dynamically resolve the location but of course, it can still display the page, as expected. Since the include is nested inside another include, DW duplicates the folder that the script resides inside. If the file is 3 files deep, it actually duplicates the folder 3 times. How do I get it to stop duplicating the folder? There is only one folder and the duplicates don't exist.

               

              Also, this is not a cache issue. I am not caching the site, at all. Like I said, when I create a new DW site, everything is fine for about an hour, but something changes. I am beginning to think it might be the code-hinting that cuases the confusion.

              • 4. Re: Dynamically related files could not be resolved...WordPress Issues
                VKray Community Member

                Not sure how to respond to your lecture, but obviously, I am doing more than editing a theme, and I want to see which files are being pulled and select blocks of code. You'd be amazed by how much is in WordPress (hidden in files that are not used off the shelf and code that's only documented in PHP comments). DW CS5 is supposed to be able to resolve these locations and I am simply looking for the feature that they advertise. I already stated that I am not looking for the obvious files. If so, I wouldn't need DW CS5. At this point, I am incredibly frustrated, and really don't need opinions based on what you think I should be doing. I am looking for a solution to my issue, which is real. It either knows how to resolve nested includes or it does not. If not, then there's no difference between CS4 and CS5 to me. I definitely don't need CS5 to edit CSS and Javascript.

                • 5. Re: Dynamically related files could not be resolved...WordPress Issues
                  David_Powers CommunityMVP

                  VKray wrote:

                   

                  After a period of time, DW gets confused and starts duplicating paths. For example, if I highlight a path to an include, I get an error that returns:

                  C:\inetpub\xampp\htdocs\blog\wp-admin\wp-admin\includes\dashboard.php contains an incorrect path.

                   

                  It's duplicating the wp-admin folder and as a result, it can't dynamically resolve the location but of course, it can still display the page, as expected. How do I get it to stop creating non-existant folders?

                  That type of problem is caused by a relative path being incorrectly interpreted. It sounds as though your testing server definition in the site setup is incorrect.

                   

                  Given the structure you have shown, the Local Site Folder and Server Folder should be C:\inetpub\xampp\htdocs\blog, and the Web URL should be http://localhost/blog/.

                   

                  If those are the settings you're using, and it's incorrectly interpreting the relative path, you should try setting up your site in a virtual host. There are details of how to create virtual hosts in Apache on my website at http://foundationphp.com/tutorials/apache22_vhosts.php.

                  • 6. Re: Dynamically related files could not be resolved...WordPress Issues
                    VKray Community Member

                    I understand what you're saying but it's kind of hard to get localhost wrong. The testing server is setup so simple that this issue makes no sense. I am not caching. Not using any rewrite scripts. I am not allowing DW to rewrite any links. Source is pulled from the testing server which is the exact same folder as the local folder. Everything is pointing at the server root. I setup a clean install multiple times now, so there can't be any confusion with other apps.

                    • 7. Re: Dynamically related files could not be resolved...WordPress Issues
                      VKray Community Member

                      Ugh, I just read your virtual host page. Thanks for the link but isn't there a simpler solution? How is dreamweaver getting so confused?

                      • 8. Re: Dynamically related files could not be resolved...WordPress Issues
                        David_Powers CommunityMVP

                        I have no idea why Dreamweaver is getting confused, although one thing did strike me as odd with your setup. You have located XAMPP inside C:\inetpub, which is normally the location for web files accessed by IIS. It might be worth running phpinfo() to check the value of DOCUMENT_ROOT. Another possibility is that you are using site-root-relative links somewhere in your site. You cannot use site-root-relative links if your site root is in a subfolder of the document root. If you want to use site-root-relative links, you must bit the bullet and create a virtual host. It's a five-minute job once you have done it the first once or twice.

                         

                        I participate in a lot of beta testing, and the message that is constantly hammered home by engineers is that the only way to identify whether something is a bug or user error is to provide reproducible steps. Without knowing how you have set up your testing server, and what happens to trigger the duplicate entry in the path, it's impossible to diagnose the problem.

                         

                        As I explained earlier, Dreamweaver uses your testing server to discover the dynamically related files. So, if the testing server is defined correctly, it should determine the path correctly. Assuming the server definition is correct, you must be doing something that triggers an error. Identify the trigger, and report it to Adobe through the bug reporting form at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform.

                        • 9. Re: Dynamically related files could not be resolved...WordPress Issues
                          VKray Community Member

                          Thank you, David, for taking the time to help me. I wanted to get back to you soooner, but I've been so busy. I am truly grateful for your help, and hope you can spare a few more minutes for my issue.

                          I did consider XAMPP's location being a problem. I already had XAMPP running when I started using DW. I had followed the instructions on their site, which only "suggested" the root for the install. It was specifically suggested because of Windows permissions. Had it been worded differently (like your blog post), I would have put it off of C:/. Not that it really matters but I have been actively using XAMPP for months. Nevertheless, I moved XAMPP to C: a few hours ago. I setup the Virtual hosts. I must admit, I really like this set-up because I can have multiple roots.

                          Unfortunately, I am now having new problems. Here's what's happening:

                          1. When I turn-on permalinks, Apache is no longer able to follow any links in the vhost site but it's fine in XAMPP. DW is fine too until I click a link because of this new server issue.

                          -----------
                          Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.  If you think this is a server error, please contact the webmaster.

                          Error 404 test1site 12/6/2010 11:28:17 AM Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 
                          -----------

                          I have tried to fix the issue and I just can't seem to figure it out. I assume I need to setup a symlink but I don't know what it needs to work properly again. I have given everyone and their mother the ability to execute/read/write off of vhosts. Do you know how to fix it? It's not only happening on WordPress permalinks (by permalink, I am referring to URLs that don't use the default "id=" setting), but the vhosted site is also unable to execute select features, like creating or resizing images with PHP.

                          2. When running in XAMPP, WordPress Permalinks are fine, and DW is actually able to follow the dynamic includes now. However, like before, it's temporary. If I disable Permalinks, DW is once again able to follow the includes (instantly resolves when I click submit via WP's admin), but again, it's only temporary. I can accept this issue if I could only get the vhost working.

                          ****

                          At this point, I simply hope to get the vhost to work like the XAMPP hosted site. As far as I've experienced so far, DW works fine in the vhost directory. DW is able to resolve the dynamic includes. It's the server itself that's having trouble with permalinks, images, etc.

                          I just know I'm so close to getting this working. Thanks for your help.

                          • 10. Re: Dynamically related files could not be resolved...WordPress Issues
                            David_Powers CommunityMVP

                            Do you have an .htaccess file in the WordPress folder?

                             

                            # BEGIN WordPress
                            <IfModule mod_rewrite.c>
                            RewriteEngine On
                            RewriteBase /blog/
                            RewriteRule ^index\.php$ - [L]
                            RewriteCond %{REQUEST_FILENAME} !-f
                            RewriteCond %{REQUEST_FILENAME} !-d
                            RewriteRule . /blog/index.php [L]
                            </IfModule>
                            
                            # END WordPress
                            
                            

                             

                            You also need to make sure mod_rewrite is enabled in XAMPP. I'm not sure whether it is enabled by default.

                            • 11. Re: Dynamically related files could not be resolved...WordPress Issues
                              VKray Community Member

                              After fiddling with this all day/night, reading Apache's docs, and searching via Google, I finally fixed the errors. Vhosts is running and scripting outside of XAMPP now. DW is working!! :) In terms of the vhost having proper access to PHP, it is a symlink issue, as well as other security blocks found on Vista SP 2. Vista security is so tight that you can't even edit the hosts file using Run As Admin or edit folder/file permissions while using Run As Admin with Windows Explorer. The only difference, between using Run As when attempting to edit file permissions or hosts, is you won't see an error upon clicking Apply or Save. It simply ignores the changes. As a result, it makes you think the changes were successfully saved. At least, that's how it works on both of my Vista PCs. It probably varies by version of Vista.  Once I get a chance, I'll post the code/steps here in case it helps someone else.

                              • 12. Re: Dynamically related files could not be resolved...WordPress Issues
                                David_Powers CommunityMVP

                                VKray wrote:

                                 

                                Vista security is so tight that you can't even edit the hosts file using Run As Admin or edit folder/file permissions while using Run As Admin with Windows Explorer. The only difference, between using Run As when attempting to edit file permissions or hosts, is you won't see an error upon clicking Apply or Save. It simply ignores the changes.

                                I switched to Windows 7 a long time ago, but I'm fairly sure it works the same as Vista in this regard. The way to edit the hosts file is to right-click Notepad in the Start menu, and select Run as Administrator. Then navigate to C:\Windows\System32\drivers\etc. To open the hosts file, select File > Open, and change the Text Documents (*.txt) option at the bottom right of the dialog box to All Files (*.*). Select hosts, and click Open. When you save the file, the changes should be saved.

                                 

                                If that doesn't work on Vista, you probably need to turn off User Access Control (UAC) in Control Panel > User Accounts.

                                • 13. Re: Dynamically related files could not be resolved...WordPress Issues
                                  VKray Community Member

                                  I wish I had seen this earlier: http://forums.adobe.com/thread/629061
                                  DW CS5 doesn't understrand WP Permalinks. This would have answered my original issue. DW would work on and off because the links were okay in the admin but when I switched to blog, it was no longer able to resolve dynamic includes because it relies on the index.php file.

                                   

                                  David, There is a major flaw in your article which caused by subsequent issues with XAMPP. It is stated over and over in Apache Core that when you use the namevirtualhost directive, and there is an IP address match, you lose the main configuration. It does NOT inherit -- ever when there's an IP match.

                                  Furthermore, I took your advice and moved XAMPP to the root of C:. I installed it under inetpub to avoid issues with permissions because user accounts are already setup and enabled by Microsoft in that directory. Since Apache runs as a local service, it loses the ability to write to files in othe directories if you have UAC enabled. Obviously, I had UAC enabled. I am not willing to disable UAC entirely. In fact, I can't disable it because I'm on a network. Once UAC is enabled, Apache can no longer write log or temp files with XAMPP unless you give it elevated permissions. To fix this and have the changes stick, you must restart Windows in safe  mode with the Network disabled. Otherwise, any changes you make using "Rus As" admin in a local role will revert. Maybe, you already gave Users ability to write. I had not done that because I keep all my web apps in inetpub where the permissions do exist. I have phython, php, IIS 6 & 7, django, Google App Engine, perl, mod perl, and more running in that folder and have never had to touch permissions. I ended up just giving the Users profile the right to modify on the vhost directory. This method comes directly from Microsoft with an explanation on why settings will revert as soon as the local domain closes.

                                  • 14. Re: Dynamically related files could not be resolved...WordPress Issues
                                    David_Powers CommunityMVP

                                    VKray wrote:

                                     

                                    I wish I had seen this earlier: http://forums.adobe.com/thread/629061
                                    DW CS5 doesn't understrand WP Permalinks.

                                    That's not correct. I have permalinks enabled in WordPress, and Dreamweaver CS5 follows the links without any difficulty.

                                    David, There is a major flaw in your article which caused by subsequent issues with XAMPP. It is stated over and over in Apache Core that when you use the namevirtualhost directive, and there is an IP address match, you lose the main configuration. It does NOT inherit -- ever when there's an IP match.

                                    Sorry, I don't follow what you're saying here. My article states: "When you enable virtual hosting, Apache disables the main server root,  so the first definition needs to reproduce the original server root." If that's not what you're referring to, please clarify. If there's a mistake in my article, I'll correct it.

                                    Since Apache runs as a local service, it loses the ability to write to files in othe directories if you have UAC enabled. Obviously, I had UAC enabled. I am not willing to disable UAC entirely. In fact, I can't disable it because I'm on a network. Once UAC is enabled, Apache can no longer write log or temp files with XAMPP unless you give it elevated permissions.

                                    Again, I don't follow your point. My suggestion about turning off UAC referred only to editing the hosts file. Maybe I should have made that clearer. Once you have edited the file, you can turn UAC back on again. The article was originally written when I used Vista on my local network. UAC was permanently turned on, except when I needed to make changes to protected files. Apache had no problem writing to its own log files. In those days, I installed PHP and MySQL manually, rather than using XAMPP, but that was the only difference.

                                    • 15. Re: Dynamically related files could not be resolved...WordPress Issues
                                      TPub Community Member

                                      I'm working on a site using DW CS5/Mamp/Wordpress and a custom theme and have run into the "dynamically-related files could not be resolved...." error when loading the root index.php file.    When I switch back from the "Day and Name" to the "Default" Permalink Setting the error disappears. Can't determine the cause.  My testing server appears to be correctly setup.  Decided to use TextMate for this site instead of DW.

                                      • 16. Re: Dynamically related files could not be resolved...WordPress Issues
                                        mgason Community Member

                                        I have the exact same problem, sites with default permalink setup work and show no error, any other setting liek day/name gives an error saying teh serveris not setup correctly.

                                        Change to default permalinks and the site works fine.

                                        Is this a Dreamweaver problem? Will it be fixed?

                                        I have the latest versions of dreamweaver and wordpress running on MAMP OSX as of march 2nd 2011

                                        Mark