Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP include files above public_html

New Here ,
Jan 30, 2017 Jan 30, 2017

I use the common PHP site file structure where include files are store above the web root. This protects sensitive include files, such as those containing database login credentials etc.

e.g.

Website root:     SiteFolder/public_html/

Website home page:     SiteFolder/public_html/index.php

Includes folder:     SiteFolder/includes/

Include file:     SiteFolder/includes/includefile.php

If I configure my local site folder as 'PathTo/SiteFolder/public_html/' and server folder as 'PathTo/SiteFolder/public_html/' I'm unable to edit and update include files.

If I configure my local site folder as 'PathTo/SiteFolder/' and server folder as 'PathTo/SiteFolder/' I can edit and update include files but Live View doesn't work. Pre-DW CC I could get round this in a clunky way by deleting 'public_html/' from the URL generated in the Live View address bar.  However this wasn't ideal and doesn't appear to be available at all in DW CC.

This is a very common file structure for robust PHP websites it doesn't appear to have ever been supported properly, if at all, by DreamWeaver.  Am I missing something or is it just not supported?

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Jan 30, 2017 Jan 30, 2017

Am I missing something or is it just not supported?

It isn't supported. DW is not a PHP IDE. PHP IDEs do handle this structure.

You can define the include directory as a separate website in DW for purposes of working on the files, and instead of live view, simply view the site in your browser.

I always create apache virtual hosts for my websites so they are quick to access in a browser and also follow the same path structure the remote website has.

Translate
LEGEND ,
Jan 30, 2017 Jan 30, 2017

I'm going to be a little controversial, and upset a few people, but first I would advise you to file a feature request for this functionality, (I know a few other have) -

https://dreamweaver.uservoice.com/

Even though Dw is trying to support a lot more file types, it is not doing so very well. It is primarily aimed at designers who want to code, and that means that server-side is probably not its priority, (or more advanced html, css, javascript).

Because it has primarily focused on designers and static sites, anything out of the ordinary in file structure has become problematic.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 30, 2017 Jan 30, 2017

Thanks for the prompt reply pziecina,

I was hoping that the significant enhancement of IDE type features, language and coding support in recent years might be accompanied by more flexible support for local and server file structures.

I'll hang on for a while to see if anyone responds with a solution or workaround a little like the one I used prior to DW CC.  If not I'll be following your advice and submitting a feature request.

Thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 30, 2017 Jan 30, 2017

Go ahead and submit your feature request .  The more people who ask for support of something, the higher priority it receives.  If nobody asks, it's not considered.

In DW 2017, under the Help menu, you'll find a direct link for Submit Bug/Feature Request.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 30, 2017 Jan 30, 2017

Am I missing something or is it just not supported?

It isn't supported. DW is not a PHP IDE. PHP IDEs do handle this structure.

You can define the include directory as a separate website in DW for purposes of working on the files, and instead of live view, simply view the site in your browser.

I always create apache virtual hosts for my websites so they are quick to access in a browser and also follow the same path structure the remote website has.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 31, 2017 Jan 31, 2017

Thanks Rob. Yes I do the same as you; running Apache virtual hosts locally makes it easy to replicate the live environment for effective local development and testing. I'm going to submit the feature request but in the meantime will continue to ignore the live view and use a browser.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 31, 2017 Jan 31, 2017
LATEST

You may also want to look at PHP IDEs. I actually go back and forth between DW and an IDE.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines