As of the release Composer version 1.0.0 on April 5,2016, composer will fail installing dependencies due to Panopoly not using a secure url. You can get around this by explicitly setting secure-http within the composer config to false.

PEAR repository from http://pear.php.net could not be loaded. Your configuration does not allow connections to http://pear.php.net/channel.xml. See https://getcomposer.org/doc/06-config.md#secure-http for details.

Panopoly should default to using https so that stuff works without special configuration in Composer. Patch to come.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tom friedhof created an issue. See original summary.

tom friedhof’s picture

Title: Composer secure-http defaults to true » Set composer repository to https
FileSize
286 bytes

Here is the patch.

tom friedhof’s picture

Status: Active » Needs review
eawheeler’s picture

Thanks for the patch. This and your other patch (https://www.drupal.org/node/2879606) are the only resources I've found addressing some serious Composer Manager installation problems for Panopoly. I'm still getting the following terminal error when enabling Composer.

PEAR repository from https://pear.php.net could not be loaded. Undefined index: channel

More seriously, after enabling I'm shut out of Drupal's configuration UI, i.e. admin/config. I get a white screen with the simple message, "The website encountered an unexpected error. Please try again later." Disabling Composer Manager restores access.

Any insight?

eawheeler’s picture

The WSOD can be avoided by using the dev version of Composer Manager, 7.x-1.x-dev.

7.x-1.8 installs certain composer files to sites/all/modules/composer_manager, not sites/default/files/composer where they belong. Installing to sites/all/modules/composer_manager creates permissions issues since the web server user shouldn't have write permissions to it. It results in the error:

RuntimeException: Error creating directory: public://composer in composer_manager_file_dir() (line 299...

Along with a WSOD at admin/config. Patches have been baked into dev that resolve the permissions issue. However, you still need to apply the patch on this page as well as the one at https://www.drupal.org/node/2879606 before installing Composer Manager dev.

ccjjmartin’s picture

Status: Needs review » Needs work

For anyone looking at this later, don't try to get this working with composer manager as it is no longer recommended for Drupal 8 after 8.1. For my source of this information see the composer manager project page description: https://www.drupal.org/project/composer_manager

Directly related to this issue, I am also getting the same "Undefined index: channel" error when switching this to https. Maybe this is related to not updating the composer.lock file and only updating the composer.json file?

Setting back to needs work since this appears it isn't working and is probably missing composer.lock updates.

dsnopek credited dsnopek.

dsnopek’s picture

Status: Needs work » Fixed

Thanks for the patch! I've committed it.

With regard to the composer_manager stuff: the current composer.json file in Panopoly is meant to pull in some development dependencies for working on Panopoly. It's NOT setup to make Panopoly into a composer "library" that can be installed via composer. That's absolutely something we should do, but this issue seems to just be about fixing the composer error when using the composer.json file as-is.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.