Test (and then possibly document) installing on shared hosting

Created on 15 January 2025, 3 months ago

Problem/Motivation

Currently Drupal CMS suggests either a local ddev install or a hosted demo. It was pointed out in slack that WordPress' installation instructions assume you're going to upload it to a shared hosting account.

Given Drupal CMS is aimed at newer Drupal users and smaller sites, it is probably worth looking at whether hosting it on shared hosting is actually possible.

The main issues are likely to be peak memory usage, and also whether package_manager/automatic updates runs.

This seems like something that a lot of people could help test with different hosting providers, and then compile the results here or elsewhere.

Steps to reproduce

Proposed resolution

User interface changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Component

General

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @catch
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    Agreed, this would be great to have!

  • πŸ‡¬πŸ‡§United Kingdom catch

    Adding some rough ideas on how to collect data to the issue summary

  • πŸ‡ΊπŸ‡ΈUnited States pendragn

    Argh, I am having issues as well!  This is on shared hosting, but I have SSH composer access, etc.  Created MySQL DB and ran

    "composer create-project drupal/cms"

    ...install seems to go fine on the command line.  Navigating in browser to webserver CMS homepage, I am greeted with a Requirements review, where the only thing wrong is no OPCache....everything else OK.  I hit "continue anyway".

    Reach Get Started Screen, no pre-configured type selected, click Next (all good so far).  Give site a name (all good so far).  Fill in MySQL DB login entries, click save and continue.  Enter in email and password for new user account.

    Get to "setting up your site" progress bar.  Progress bar reaches end all fine.  Then the errors flash on screen and the site is not reachable at all through the browser:

    3x error boxes all with the error at the bottom:  "RuntimeException: Failed to start the session because headers have already been sent ..... at line 296"

    Continuing to the error page I get this:  

    RuntimeException: Failed to start the session because headers have already been sent by "/home/honeyp7/public_html/MYDOMAIN/web/cms/web/core/includes/errors.inc" at line 296. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 116 of /home/honeyp7/public_html/MYDOMAIN/web/cms/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).

    Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (Line: 128)
    Drupal\Core\Session\SessionManager->startNow() (Line: 93)
    Drupal\Core\Session\SessionManager->start() (Line: 59)
    Symfony\Component\HttpFoundation\Session\Session->start() (Line: 1566)
    install_bootstrap_full() (Line: 695)
    install_run_task() (Line: 572)
    install_run_tasks() (Line: 121)
    install_drupal() (Line: 53)

    Anyone know any ideas why this error is happening?

  • πŸ‡ΊπŸ‡ΈUnited States pendragn

    Argh, I am having issues as well!  This is on shared hosting, but I have composer access, etc.  Created MySQL DB and ran

    "composer create-project drupal/cms"

    ...install seems to go fine on the command line.  Navigating in browser to webserver CMS homepage, I am greeted with a Requirements review, where the only thing wrong is no OPCache....everything else OK.  I hit "continue anyway".

    Reach Get Started Screen, no pre-configured type selected, click Next (all good so far).  Give site a name (all good so far).  Fill in MySQL DB login entries, click save and continue.  Enter in email and password for new user account.

    Get to "setting up your site" progress bar.  Progress bar reaches end all fine.  Then the errors flash on screen and the site is not reachable at all through the browser:

    3x error boxes all with the error at the bottom:  "RuntimeException: Failed to start the session because headers have already been sent ..... at line 296"

    Continuing to the error page I get this:  

    RuntimeException: Failed to start the session because headers have already been sent by "/home/honeyp7/public_html/MYDOMAIN/web/cms/web/core/includes/errors.inc" at line 296. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 116 of /home/honeyp7/public_html/MYDOMAIN/web/cms/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php).

    Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (Line: 128)
    Drupal\Core\Session\SessionManager->startNow() (Line: 93)
    Drupal\Core\Session\SessionManager->start() (Line: 59)
    Symfony\Component\HttpFoundation\Session\Session->start() (Line: 1566)
    install_bootstrap_full() (Line: 695)
    install_run_task() (Line: 572)
    install_run_tasks() (Line: 121)
    install_drupal() (Line: 53)

    Anyone know any ideas why this error is happening?

  • πŸ‡¬πŸ‡§United Kingdom catch

    @pendragn this issue was more for Drupal CMS contributors to try installing Drupal CMS on shared hosting and report back, hopefully to pre-empt some of the issues you're having on different hosts. For actual support, you would probably get better answers in #drupal-cms-support on Drupal slack.

    Having said that, this error you pasted shows that the installer didn't complete successfully. You should try wiping your database and re-installing, I would do so without any of the optional recipes to minimise what needs to be installed. If you end up in exactly the same place again, it'd be good to report that back here but real-time (or closer to real time) help on slack will probably help you get going faster. Also if you're able to share details of which shared host you're on that would be really useful for the purposes of this issue.

    Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (Line: 128)
    Drupal\Core\Session\SessionManager->startNow() (Line: 93)
    Drupal\Core\Session\SessionManager->start() (Line: 59)
    Symfony\Component\HttpFoundation\Session\Session->start() (Line: 1566)
    install_bootstrap_full() (Line: 695)
    install_run_task() (Line: 572)
    install_run_tasks() (Line: 121)
    install_drupal() (Line: 53)
    
  • πŸ‡¦πŸ‡ΊAustralia juxe

    Drupal CMS works on Ventraip shared hosting.

    Steps taken:
    - Created a new database and database user
    - Switched on missing required PHP extensions (gd, pdo, pdo_mysql, mbstring, opcache)
    - Used cpanel Terminal to run "composer create-project drupal/cms newdirectory" from the home directory
    - Used cpanel Domains->[domain name]->manage to change the root directory of one of my addon domains to newdirectory/web
    - Installed using the UI with the news recipe selected
    - Switched the site to maintenance mode

    The site runs great, pages are fast to load. I created new content and installed modules from the Extend->List tab successfully.

    Notes
    =====
    - After running composer create-project I'm instructed to run ./launch-drupal-cms.sh. I ignored it as that's just for ddev... isn't it?

    - Trusted Host Settings error. Not able to change it directly in cpanel, had to use ftp to download the file, change locally and upload to get around permission errors even after the file was chmod 777. Easy to fix but breaks the idea of everything possible from the browser so I'm mentioning it here.

    Issue
    =====
    Drupal CMS can't find composer. Error messages that Composer is not found are shown:
    -- in the status report
    -- in Extend->Browse tab
    -- in Extend->Recipes tab
    -- in Extend->Update tab

    Visiting Extend->Update Extensions tab triggers an error. "The website encountered an unexpected error. Try again later."
    The Exception is: PhpTuf\ComposerStager\API\Exception\LogicException: The composer executable cannot be found. Make sure it's installed and in the $PATH in PhpTuf\ComposerStager\Internal\Finder\Service\ExecutableFinder->find() (line 34 of [path-to]/vendor/php-tuf/composer-stager/src/Internal/Finder/Service/ExecutableFinder.php).

    So the Drupal CMS install works, I just can't perform updates through the UI that require composer. I can do it through the terminal though.

  • πŸ‡¬πŸ‡§United Kingdom catch

    Thanks for testing! This is really useful.

    - After running composer create-project I'm instructed to run ./launch-drupal-cms.sh. I ignored it as that's just for ddev... isn't it?

    Yes it is, the language should be removed as a prompt I think, can stay in a README.md and online docs - could you open an issue?

    - Trusted Host Settings error. Not able to change it directly in cpanel, had to use ftp to download the file, change locally and upload to get around permission errors even after the file was chmod 777. Easy to fix but breaks the idea of everything possible from the browser so I'm mentioning it here.

    I think this needs a core issue to discuss, e.g. can we still tell people they could do this, but make it 'info' rather than 'error'.

    Visiting Extend->Update Extensions tab triggers an error. "The website encountered an unexpected error. Try again later."
    The Exception is: PhpTuf\ComposerStager\API\Exception\LogicException: The composer executable cannot be found. Make sure it's installed and in the $PATH in PhpTuf\ComposerStager\Internal\Finder\Service\ExecutableFinder->find() (line 34 of [path-to]/vendor/php-tuf/composer-stager/src/Internal/Finder/Service/ExecutableFinder.php).

    This is quite serious. First of all the error should be handled by either package_manager or automatic_updates module so it's not fatal. Secondly we would want people on shared hosting to be able to use the module - could you open an issue against core package_manager to start with? It might need to be moved/split elsewhere but that's probably in the middle of where it would need to be moved to.

  • πŸ‡¨πŸ‡¦Canada kathc

    It's not shared hosting, but I wrote a very brief blog post about installing on Cloudways (it just worked after a few settings). https://alakasam.ca/node/32

  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    Related in Project Browser queue for awhile ago:

    πŸ“Œ [META] Test project browser on popular hosting providers Active

  • πŸ‡¬πŸ‡§United Kingdom dunx

    Great topic.

    The three hosting providers being recommended by Drupal at https://new.drupal.org/drupal-cms/trial under the Ready to launch? Find a Drupal host heading (Acquia, Pantheon and Platform.sh) are very unlikely to be the sort of service that somebody who wants to knock up a quick website can afford. I know there's some free/time-limited options, but these are typically Β£$€100s per month, when users are probably looking for that per year. We risk putting new users off immediately and losing them very quickly and forever if they believe those are the necessary or typical costs for hosting Drupal CMS.

  • πŸ‡¦πŸ‡ΊAustralia juxe

    Added my newly created related issues (I think).

  • πŸ‡¦πŸ‡ΊAustralia juxe

    I also have an old A2Hosting shared hosting account.
    I tried to install Drupal CMS there but no success. The database version was lower than the minimum required.

    It's an old account so I can't really say if someone purchasing one today would have the same issue.

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    Adding automatic updates hosting test issue, where I tested Dreamhost and Siteground. Those test issues are at https://www.drupal.org/project/issues/search?issue_tags=hosting%20test β†’

  • I tried to install drupal through the web installer several times, but the installation ended with errors. There have always been different mistakes, so I'll wait for it to be fixed.
    And the biggest problem of the installation is the inflated database versions. The developers are guided by the date of database support, but do not take into account that each hosting has different versions of databases that cannot be updated with drupal. Therefore, drupal has taken a big step back by allowing only new versions of databases to be installed. But for example, postgres 15 support will end in 3 years, and drupal with postgres 15 cannot be installed with drupal version 11. Why not do it in two years?

  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    We're working on a number of similar issues over at https://www.drupal.org/project/project_browser/issues/3453713 πŸ“Œ [META] Test project browser on popular hosting providers Active and I am starting to think we may be duplicating efforts here. PRIMARILY, the question is whether or not PACKAGE MANAGER can work on these hosting environments, and Project Browser, Automatic Updates (and therefore Drupal CMS capitalizing on those features) follow suit from there.

    Should we move all of our various METAs into the core queue with component Package Manager or into a documentation issue queue?

    In my ideal world, we would have a list of like "Making modern Drupal work on {Hostinger, Cloudways, GoDaddy}" documentation pages...

  • πŸ‡¬πŸ‡§United Kingdom dunx

    Yes to the ideal world of @chrisatredfin :)

    Do the Drupal Association have any bandwidth to speak to the any of the big cheap hosting providers to help us help them?

    Many of them already say they can host Drupal, whilst still using the old Drupal 8 logo for example. Perhaps it's in their interest to be more proactive in this respect. They would also be doing some marketing for Drupal CMS in getting their solutions out in front of their massive user base

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    I think there are some extra considerations for Drupal CMS, due to the size of shipped packages especially with Experience Builder (which was an issue for Drupal Forge for example recently). Also memory requirements, and similar things. But otherwise I think the testing is similar indeed.

    However I think ultimately we would want documentation about Drupal CMS running on shared hosts, so from that perspective, running the process with Drupal CMS itself would be best.

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    Making title more explicit for sharing :)

  • πŸ‡¬πŸ‡§United Kingdom catch

    We're working on a number of similar issues over at https://www.drupal.org/project/project_browser/issues/3453713 πŸ“Œ [META] Test project browser on popular hosting providers Active and I am starting to think we may be duplicating efforts here.

    Yes me too, I didn't realise that issue was already open.

    But also fully agreed with Gabor's points - just Drupal core + project browser might not show up potentially showstopper issues with things that memory usage that could be exposed by Drupal CMS, purely down to more projects in the code base/installed as well as the recipe system being in use. So it would be good to expand the scope of the original issues if we can?

  • πŸ‡ͺπŸ‡¨Ecuador danieluxury

    Composer2 - Hostinger shared hosting problem.

    I installed Drupal CMS on Hostinger Shared account trough ssh, on a subdomain (daniel.seriousdesign.net) , following this procedure:

    • Created subdomain.
    • Created a database.
    • Access ssh, and subdomain folder.
    • Execute
    • composer2 create-project drupal/cms .
    • cd daniel
    • git init
    • Add a .gitignore file https://www.drupal.org/project/drupal_cms/issues/3500134 ✨ Add a default `.gitignore` to composer project Active
    • Visit site and configure
    • Did not work, not sure why, but I modified settings.php to enable settings.local.php
    • $settings['config_sync_directory'] = '../config/sync';
    • $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
    • $config['system.logging']['error_level'] = 'verbose';
    • $config['system.performance']['css']['preprocess'] = FALSE;
    • $config['system.performance']['js']['preprocess'] = FALSE;
    • vendor/bin/drush cr

    site started working.

    upload repository on github, cloned and performed composer install, but workflow was not what I expected.

    But when I visit admin/reports/status I get the errors on attached image.

    I am not a seasoned developer, so maybe what I was doing trying to create a development workflow on new Drupal CMS.

  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    I bought Bluehost's cheapest plan today. They install WordPress in every single plan automatically. It takes a lot of care to find where to install Drupal but one can go to their Hosting page, then find the "Cpanel" link (I know this, but not sure general people would know what Cpanel is). Then scroll all the way to the bottom. Drupal is not listed there. CMS/Portals is a category that is offered, and THAT lists Drupal 11.

    This is on a software called Softaculous that is embedded in CPanel. It has 3 Install buttons for Drupal, one does not do anything, the second only switches to other install options, the real one is placed near a "Send instructions in email" field, which is strange and I was ready to receive the instructions in email. But it did attempt to install. It cannot install because .htaccess and index.php were present (from WordPress). It offered to replace them or for me to pick a subdirectory. It would not replace the whole of WordPress, just those files, so I went with a subdirectory. It installed SUPER FAST then. Now I have a Drupal 11 site inside my WordPress site.

    Not sure we can suggest Bluehost by any means (even once/if Softaculous offers Drupal CMS too). That said, it did install Drupal 11 in a matter of seconds, so Softaculous has it figured out very well apparently :)

  • πŸ‡¬πŸ‡§United Kingdom catch

    It offered to replace them or for me to pick a subdirectory. It would not replace the whole of WordPress, just those files, so I went with a subdirectory. It installed SUPER FAST then. Now I have a Drupal 11 site inside my WordPress site.

    This is impressive and of all the things I could have predicted, would never have come up with it.

  • πŸ‡¦πŸ‡ΊAustralia pameeela

    I tried out A2Hosting, but my conclusion is that setting up manually is not really worth documenting, considering how complicated it is compared with the Softaculous installer for Drupal. We should try to get Drupal CMS added as an option to that instead.

    FWIW I got Project Browser working using the default Drupal 11 install and documented this in the guide β†’ .

    If we are able to get Drupal CMS as an option, much of this setup would be automatic and if we could even get the Composer path set by the installer there would be no manual steps required to use it.

  • πŸ‡«πŸ‡·France nod_ Lille

    is it possible to check the availability of nodejs on the shared hosting while looking at all this? just a yes/no would be great

  • πŸ‡¬πŸ‡§United Kingdom dunx

    Even AWS Lightsail is talking about Drupal 7 and 8 installation via Bitnami :|

    https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-...
    https://docs.bitnami.com/aws/apps/drupal/configuration/install-plugins/

    If Drupal CMS is going to succeed, it needs to be as easily installed as Wordpress on "cheap" hosting.

    This feels like a major blocker to uptake for me right now. Sure, I could probably get it working somewhere cheap as others already have, but we're Drupal experts. What about these marketers we're talking about?

    I appreciate I'm not offering answers or solutions.

Production build 0.71.5 2024