Git Product home page Git Product logo

Comments (10)

schlessera avatar schlessera commented on June 15, 2024 1

Yes, but this only works given the right access. In my particular use case, there's an IT department that creates a space for the website, and the developers are meant to fill it in with HTML & PHP. No cPanel access and only a limited subset of .htaccess.

That's why I wanted to find a way for WPStarter to allow for a more flexible placement for .env.

from wpstarter.

GaryJones avatar GaryJones commented on June 15, 2024

The writing of the .env.example should probably try and take advantage of this too, with fallback to current dir, and notice within the command line output, if it can't write to the parent directory.

The composer extra option should be treated as a preference, but the installer should give a working setup at the end regardless.

from wpstarter.

gmazzap avatar gmazzap commented on June 15, 2024

Surely .env goes out of webroot. I normally put it in root folder, but place webroot in a subfolder.

This is also the suggested way in documentation: have a /public subfolder as webroot.

I think it's easier to use a subfolder for webroot instead of assuming that wp starter root is the webroot. This is the way most frameworks works...

from wpstarter.

schlessera avatar schlessera commented on June 15, 2024

@Giuseppe-Mazzapica: That makes total sense and should be the recommended way.

But what would you suggest for a scenario where the webroot can not be moved (developer != sysop)?

from wpstarter.

gmazzap avatar gmazzap commented on June 15, 2024

@schlessera in a lot of cases a .htaccess can be used to set webroot to subfolder.

Even if that probably won't work with nginx...

from wpstarter.

gmazzap avatar gmazzap commented on June 15, 2024

Moreover, most control panels like cPanel and similar allow to setup webroot...

from wpstarter.

schlessera avatar schlessera commented on June 15, 2024

I realize this might not be the most common scenario, but currently WP-Starter does not provide any entry point for providing a custom path to .env. I don't intend to change the default or recommended behaviour, just provide something to support some more edge cases.

from wpstarter.

gmazzap avatar gmazzap commented on June 15, 2024

that's sounds fine. There's possibility to provide custom .env file name, have you tried to use a relative path like ../.env? Not sure it will work, but it could.

from wpstarter.

franz-josef-kaiser avatar franz-josef-kaiser commented on June 15, 2024

@Giuseppe-Mazzapica About Nginx there's the root directive that allows to set a different document root for each server you define. In short, it's possible, in fact there is no difference to Apache.

from wpstarter.

gmazzap avatar gmazzap commented on June 15, 2024

v3 provides a way to customize location of .env file.

Since this is not gonna change for v2, I consider this done and will close it.

Thanks anyone involved.

from wpstarter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.