Comments (10)
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.
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.
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.
@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.
@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.
Moreover, most control panels like cPanel and similar allow to setup webroot...
from wpstarter.
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.
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.
@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.
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)
- ENV File Behavior and Manipulation #Question HOT 4
- EnvExampleStep concatenates two absolute paths HOT 2
- ETA for `v3` release with Composer 2 support? HOT 2
- Is it possible, I could use WPStarter with PHPUnit for WordPress plugin / theme tests? HOT 1
- Allow composer installers v2 HOT 3
- Can't contribute due to dependencies HOT 4
- composer wpstarter flush-env-cache not working HOT 4
- Fatal error in Steps::count()
- WPStarter v3 .env custom constant `Type` for error_reporting. HOT 2
- Documentation: how to publish wpstarter branch-based app builds, similar to Netlify etc JS apps HOT 3
- Support a Newer Version of vlucas/phpdotenv HOT 4
- How to access wp-json (REST API)? HOT 1
- v3 Not Compatible with Pantheon or read-only root file systems HOT 18
- 3.0.0-beta.9: with `.env` cache loaded, site is always Environment Type "production" HOT 7
- v3.0.0-beta.10: mu-plugins "monorepo" only gets first file installed? HOT 4
- Folder name must be in string error HOT 5
- PHP 8.1 Compatibility Timeline? HOT 2
- Env loading/overriding/naming HOT 4
- Forced Install of `wp-content/mu-plugins/wpstarter-mu-loader.php` Conflicts with Existing MU Plugin Loaders HOT 5
- PHP 8.3 compatibility HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpstarter.