Score:-2

Configure composer install path

id flag

Trying to install drupal via composer on a shared server.

The complete path to my website looks like this :

/srv/data/web/vhosts/mysite.tld/htdocs/

i have (limited) terminal access and write permissions on the two last directories :

mysite.tld and htdocs.

htdocs is the directory accessible through the web browser.

I installed composer then ran the following command from within mysite.tld directory :

composer.phar create-project drupal/recommended-project:8.9.20 "install-dir"

Now inside mysite.tld directory, i have the htdocs folder and install-dir folder that contains :

.editorconfig
.gitattributes
composer.json
composer.lock
vendor/
web/

I'm looking for a way to use install-dir/web/ as the htdocs/ folder and have it accessible through the browser.

Thanks

id flag
Drupal 8 reached end of life in November 2021.
NSTK avatar
id flag
Thanks, but that's not the point. My server has limited php support 7.2 or 7.3 i think; so i can't install the latest drupal version. But even if i was installing the latest drupal version, my directory issue would be the same, so ...
cn flag
It really sounds like you want to move everything up from install-dir to mysite.tld, and rename web to htdocs (also updating any references to web/ in composer.json). Otherwise this is more of a question for your hosting provider (how do I point the web root to a new path?)
Jaypan avatar
de flag
Clive gave the correct answer. Move EVERYTHING in `/install-dir` up one directory, edit `composer.json` and change the webroot from `/web` to `/mysite.tld`, then run composer install.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.