• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Resolved Module installation of DRUPAL 8 using Plesk composer?

Jürgen_T

Regular Pleskian
I am currently setting up a new site using DRUPAL 8 as provided as application in Plesk. To install modules of Drupal 8 a recommended procedure is to use composer i.e. using commands like composer require drupal/"wished module" in the console. I am wondering whether I can do this also with the composer coming with Plesk Obsidian? So I have three questions:
1. Do I have to install composer on my server in addition to my PLESK Obsidian installation, where composer seems to be already part of?
2. Can I use the composer coming together with PLESK Obsidian directly for installing modules in Plesk?
3. If 2nd is true how to do this?
 
Pre-requisites: subscription with physical hosting, allow SSH access for system user, install Drupal from Plesk catalog.
Login under system user by SSH
----------------------------------------------------------------
-bash-4.2$ pwd
/var/www/vhosts/d4.a10-52-31-63.qa.plesk.ru/httpdocs
-bash-4.2$ which composer
/usr/bin/composer
-bash-4.2$ rpm -qf /usr/bin/composer
plesk-service-node-utilities-18.0-2.centos.7+p18.0.20.0+t191004.1750.x86_64
-bash-4.2$ php -v
PHP 7.2.23 (cli) (built: Oct 2 2019 17:47:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.1, Copyright (c) 2002-2018, by ionCube Ltd.
with Zend OPcache v7.2.23, Copyright (c) 1999-2018, by Zend Technologies
-bash-4.2$ ls modules/
README.txt
-bash-4.2$
----------------------------------------------------------------

Try to install any extension, for example drupal/Token
----------------------------------------------------------------
-bash-4.2$ composer require drupal/Token
Using version ^1.5 for drupal/token
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 35 installs, 0 updates, 0 removals
- Installing ircmaxell/password-compat (v1.0.4): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing drupal/token (1.5.0): Downloading (100%)
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing symfony/css-selector (v3.4.26): Downloading (100%)
...
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
-bash-4.2$

Looks like really installed:
-bash-4.2$ ls modules/contrib/token/
css LICENSE.txt src tests token.info.yml token.libraries.yml token.module token.routing.yml token.tokens.inc
js README.md templates token.drush.inc token.install token.links.task.yml token.pages.inc token.services.yml
-bash-4.2$
 
I am currently setting up a new site using DRUPAL 8 as provided as application in Plesk. To install modules of Drupal 8 a recommended procedure is to use composer i.e. using commands like composer require drupal/"wished module" in the console.

Hi @Kulturmensch,
Yes, Drupal provided as an application in Plesk is adopted for composer and contains composer.json.
But.. unfortunately, this "composerization" is based on old deprecated project "drupal/drupal": drupal/drupal
This composer template is now deprecated and has several disadvantages. Drupal.org recommends to use "drupal-composer/drupal-project": drupal-composer/drupal-project
This template has a better file structure and allows you to update drupal core or themes & modules using composer.

* checkout git repo to my domain: drupal-composer/drupal-project (btw, this step might be also performed using Plesk UI)
* execute "Update" in PHP Composer
* Create DB and DB user in Plesk, go to <mydomain>/web/install.php to configure Drupal in web browser.
After that my Drupal is working and I can update any components including Drupal Core using composer.
 
Yes, the Drupal application offered by Plesk is used for composer and includes composer.json.
However, this "composerization" is based on the obsolete "drupal/drupal" project: drupal/drupal
This composer template is no longer supported and has a number of drawbacks. "drupal-composer/drupal-project" is recommended by Drupal.org: drupal-composer/drupal-project

This template has a better file structure and allows you to use composer to update Drupal core, themes, and modules.



* checkout git repo to my domain: drupal-composer/drupal-project (btw, this step might be also performed using Plesk UI)

* execute "Update" in PHP Composer

* Create DB and DB user in Plesk, go to <mydoma
 
Back
Top