Closed lindseydiloreto closed 3 years ago
@lindseydiloreto do you have an environment variable where you are setting the path?
SITE_BASEURL="http://project.test"
SITE_BASEPATH="/app/public"
On my other projects (where I don't seem to be having this issue), the variables are called CONFIG_SITEURL
and CONFIG_SITEPATH
respectively. I believe those are the Craft default names... does Nitro reference CONFIG_SITEPATH
explicitly?
Nitro sets only PHP specific settings and uses the .env
to load what you set. Are there any aliases for the web/root?
Not sure if this is what you're asking, but these are my Craft aliases in config/general.php
...
'aliases' => [
'@web' => null,
'@webroot' => getenv('SITE_BASEPATH'),
'@baseUrl' => getenv('SITE_BASEURL'),
'@basePath' => getenv('SITE_BASEPATH'),
'@assetsUrl' => getenv('SITE_BASEURL').'/assets',
'@assetsPath' => getenv('SITE_BASEPATH').'/assets',
'@resourcesUrl' => getenv('SITE_BASEURL').'/resources',
],
I got this all sorted out! It was a fundamental misunderstanding of what the /app
directory was mapped to.
- hostname: project.test
path: ~/Sites/projects
version: "7.4"
webroot: path/to/site/public
xdebug: false
blackfire: false
In this context, the /app
directory would be mapped to ~/Sites/projects
. Once I realized that, I was able to correct my webroot
accordingly.
Thanks for all of your help getting this cleared up @jasonmccallister! 🍺
Description
It seems like Nitro is determined to put a
cpresources
directory at thepath
, instead of at thewebroot
. Not sure if there's a bug in Nitro, or if I'm just doing something wrong.Whenever I load a page of the CP, it incorrectly creates and/or updates this directory...
... instead of the expected directory...
It's possible that there's a mistake on my end, if so just let me know!
Steps to reproduce
path
andwebroot
are separate directories.cpresources
directory was created in thepath
instead of thewebroot
.Additional info