I am moving from Drupal 7 to Drupal 9. Anyway, when installing with composer WEB folder is created where my site files are moved. This seems to imply that my site now is at mysite/web. This not where I need it. When I move files into the root directory, the site does work because it can't find the file autoload. Can you please help resolve this mystery?

Comments

vm’s picture

/web/ is the default project folder based on the composer command you used. The doc root should then be pointed to the /web/ folder. Moving the files/folders around after a composer install will cause issues.

That said, if you don't want /web/ and want a differently named project folder you dictate that to composer using your install command and then the doc root must point to that project folder.

jacktiler’s picture

Thank you for getting back to me so quickly. I am still confused. I installed Drupal 9 manually, that is uploading the files into the root directory, and all the files were moved into the root directory. No web directory was created. 

vm’s picture

the above is the non-composer method of installing drupal which of course does not include a web folder since its not a composer based project.

note: mixing composer v non composer tasks in a singular site is a pathway to headache. So pick a method and stick to it.

If you avoid composer you will need to look into another method to manage 3rd party libraries. ie: Ludwig or some other. As such, I fully suggest sticking with composer and learning how to properly manage the site with the new tools.

jacktiler’s picture

which still seem to contain composer files

vm’s picture

you are conflating two things. Yes. There are composer files included in core. Where do you think composer gets its integration into Drupal from?

Composer is NOT a module. It is a 3rd party command line tool and Drupal 8+ has been written so that composer can be fully integrated and utilized to manage the project and third-party libraries needed to run core as well as contrib and custom modules. This management process allows developers to lock in on a 3rd party library versioning to insure an update to a 3rd party library used does not break a site etc.

jacktiler’s picture

I don't think. I just find this very misleading. Two methods of installing one product give two different results. 

vm’s picture

who or what is misleading you? You chose one of two different paths of installation and expect the scenery to be exactly the same?

IMO that's not an attempt to mislead those installing (after all its documented in multiple ways), rather (from where I sit) its a misunderstanding on your part since you are D7-focused and now playing catch up with the new tools that have been deployed. Have you taken the time to read the composer documentation here on drupal.org? if no, doing so will help. There are also many many videos and written tutorials out there that can be found with google that will aid in providing more information related to the change, why the change, and how it benefits. You can of course focus on the cons (many have) but that doesn't get a site built with Drupal.

jacktiler’s picture

You are being rude and patronizing 

vm’s picture

fair enough. I fully understand that the truth hurts sometimes (especially when it's delivered bluntly) and with it an adverse reaction causes them to lash out and resort to name-calling (taking things personally that shouldn't be) when they are faced with a truth they don't want to recognize. Kinda immature but it is the internet after all.

jaypan’s picture

You have two options:

1) Move one directory up, and install from Composer from the directory above. Create a simlink from your web directory to the /web directory. Or:

2) Change your server settings to set the webroot as the /web directory.

More info on Composer: https://www.morpht.com/blog/drupal-and-composer-part-1-understanding-com...

Contact me to contract me for D7 -> D10/11 migrations.

ressa’s picture

Thanks @Jaypan, symlinking sounds interesting. Perhaps you can share the exact commands required to do this, just for a standard Drupal 10 installation?

ressa’s picture

I created Relocated web root on shared hosting with symlink, and it would be great if you gave it a look over @Jaypan, to make sure it's all right.

jaypan’s picture

It looks good to me. Have you tested it?

Contact me to contract me for D7 -> D10/11 migrations.

ressa’s picture

Yes, I am using it right now :)

(It was since moved, I am updating the link, but I guess you found it.)

jacktiler’s picture

Thank you