0

I have just updated to Ubuntu 20.04 so have a fresh install of everything.
I have a working Drupal 7 site I'll call mysite.
I have Drush-launcher installed globally at /usr/local/bin/drush
The file structure of the site is the following.

  • /var/www/mysite/composer.json (to install Drush 8.4.1)
  • /var/www/mysite/vendor/drush/drush/drush (local Drush 8.4.1 binary)
  • /var/www/mysite/web
  • /var/www/mysite/public_html (symlink to web)
  • /var/www/mysite/web/sites

Drush works with this configuration. drush status returns a full and accurate site description of about 15 lines.

If I remove the public_html link, the Drupal site runs fine but most Drush commands no longer work. drush status returns only the bare minimum of 7 lines as it does when it can't find the site. drush --version does return the correct version number either way and if I move the Drush 8 directory, all Drush commands return an error as expected. (This shows I'm still using the correct binary).

I have several Drupal 8 sites that are configured this exact same way (no public_html directory or link) and they work as expected.

I have searched in the ~/.drush directory for any reference to public_html and there are none related to this site. I have cleared the Drush cache. There are no references to public_html in my Apache config for the site. Searching isn't turning up anything useful.

I could just leave the public_html link in the filesystem but git wants me to add it or ignore which seems kinda silly.

What might I be doing wrong?

2
  • 4
    You say you have no references to public_html anywhere, but what made you try creating a symlink from public_html to web?
    – sonfd
    Sep 14 '20 at 18:31
  • That's how I had it set up originally. I had copied that structure from prod. Prod does use the public_html. That was the easiest way for me to get git/drush to work back in the days when I had drush installed globally. I reorganized the structure on my local once I started installing Drush via Composer. Sep 14 '20 at 19:30
0

Solved it!

Thanks to @sonfd for making me think more about the composer installation. Look what I found in there:

"extra": {
  "installer-paths": {
    "public_html": [
      "type:drupal-core"
    ]
  }
},

I changed that from public_html to web and it works. Damn.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.