cweiske / phorkie

Self-hosted pastebin software written in PHP. Pastes are editable, forkable, may have multiple files and are stored in git repositories.
https://cweiske.de/phorkie.htm
GNU Affero General Public License v3.0
216 stars 23 forks source link

Failure using composer for dependency installation #28

Closed mikini closed 7 years ago

mikini commented 7 years ago

On Ubuntu 16.04 trying to install dependencies using composer errors because of insecure http:

~/phorkie$ composer install
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
PEAR repository from http://pear.php.net could not be loaded. Your configuration does not allow connection to http://http://pear.php.net. See https://getcomposer.org/doc/06-config.md#secure-http for details.
Initializing PEAR repository http://pear2.php.net
PEAR repository from http://pear2.php.net could not be loaded. Your configuration does not allow connection to http://http://pear2.php.net. See https://getcomposer.org/doc/06-config.md#secure-http for details.
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package pear-pear.php.net/date_humandiff could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package pear-pear.php.net/http_request2 could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package pear-pear.php.net/pager could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package pear-pear.php.net/openid could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package pear-pear.php.net/services_libravatar could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package pear-pear.php.net/versioncontrol_git could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package cweiske/mime_type_plaindetect could not be found in any version, there may be a typo in the package name.
  Problem 8
    - The requested package pear-pear2.php.net/pear2_services_linkback could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Trying to allow insecure http (the obvious addition of https to urls also fails):

~/phorkie$ git diff -U0
diff --git a/composer.json b/composer.json
index 8e91f29..5eb4065 100644
--- a/composer.json
+++ b/composer.json
@@ -43 +43,2 @@
-        "vendor-dir": "lib/"
+        "vendor-dir": "lib/",
+        "secure-http": false

Now the single pear2.php.net package is found but the pear.php.net repository cannot be loaded because of an undefined index "channel":

phorkie$ composer install
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
PEAR repository from http://pear.php.net could not be loaded. Undefined index: channel
Initializing PEAR repository http://pear2.php.net
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package pear-pear.php.net/date_humandiff could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package pear-pear.php.net/http_request2 could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package pear-pear.php.net/pager could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package pear-pear.php.net/openid could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package pear-pear.php.net/services_libravatar could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package pear-pear.php.net/versioncontrol_git could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package cweiske/mime_type_plaindetect could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Trying to clear cache and verbose logging helps nothing but reveals that the repository is accessed but composer/pear seems to fail on parsing its content.

~/phorkie$ composer clearcache && composer install -vvv
Clearing cache (cache-dir): /home/<undisclosed-user>/.composer/cache
Clearing cache (cache-files-dir): /home/<undisclosed-user>/.composer/cache/files
Clearing cache (cache-repo-dir): /home/<undisclosed-user>/.composer/cache/repo
Cache directory does not exist (cache-vcs-dir): 
All caches cleared.
Reading ./composer.json
Loading config file ./composer.json
Checking CA file /etc/ssl/certs/ca-certificates.crt
Executing command (/home/<undisclosed-user>/phorkie): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/<undisclosed-user>/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Downloading http://pear.php.net/channel.xml
Downloading https://pear.php.net/rest/c/categories.xml
Downloading https://pear.php.net/rest/c/Audio/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Authentication/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Benchmarking/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Caching/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Configuration/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Console/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Database/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Date+and+Time/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Encryption/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Event/packagesinfo.xml
Downloading https://pear.php.net/rest/c/File+Formats/packagesinfo.xml
Downloading https://pear.php.net/rest/c/File+System/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Gtk+Components/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Gtk2+Components/packagesinfo.xml
Downloading https://pear.php.net/rest/c/GUI/packagesinfo.xml
Downloading https://pear.php.net/rest/c/HTML/packagesinfo.xml
Downloading https://pear.php.net/rest/c/HTTP/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Images/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Internationalization/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Logging/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Mail/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Math/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Multimedia/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Networking/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Numbers/packagesinfo.xml
Downloading https://pear.php.net/rest/c/Payment/packagesinfo.xml
Downloading https://pear.php.net/rest/c/PEAR/packagesinfo.xml
PEAR repository from http://pear.php.net could not be loaded. Undefined index: channel
Initializing PEAR repository http://pear2.php.net
Downloading http://pear2.php.net/channel.xml
Downloading http://pear2.php.net/rest/c/categories.xml
Downloading http://pear2.php.net/rest/c/HTTP/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/DB/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Templates/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/PEAR2/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Default/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Caching/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Text/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Net/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Console/packagesinfo.xml
Downloading http://pear2.php.net/rest/c/Services/packagesinfo.xml
Downloading https://packagist.org/packages.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Downloading http://packagist.org/p/provider-2013%24820c572aae880e209d5de73ada835ae20a2ab8f93c50dae781496c5f831527a6.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2013.json into cache
Downloading http://packagist.org/p/provider-2014%2416329fd363d6a51b89245f0f7cc939370c32de5b059c05b42aeba2c2ff238e99.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2014.json into cache
Downloading http://packagist.org/p/provider-2015%249ebc47402c08555733f967d52c16f75dc5b18eaaf9a1790819c01f4deb1cee1b.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2015.json into cache
Downloading http://packagist.org/p/provider-2016%243e2f600755a397e775b238f03b969f3e5da0d919990f5e9868774a82f9c46dc1.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2016.json into cache
Downloading http://packagist.org/p/provider-2016-10%247f2ae83bd299dbc998525788a73a5105831c0e86fcdaa853239a3e8c26e75a3a.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2016-10.json into cache
Downloading http://packagist.org/p/provider-2017-01%24dcc537c7f5b8a03cde8fb61517a2f7ea8f20953c7aa7bed3e8c51400e3a91f19.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2017-01.json into cache
Downloading http://packagist.org/p/provider-2017-04%24078049be444de8b7fbef157161e0c6265f37d65553319aa3d5cb5b53f268d1a0.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2017-04.json into cache
Downloading http://packagist.org/p/provider-2017-07%24125a63176e3729dd915230cb51984e2d4c7a4d3cfb3c393217cc047e0acf72fa.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-2017-07.json into cache
Downloading http://packagist.org/p/provider-archived%24a62350f91d04b0a93e1d59f79e702a69f6c099a37d02d68c97c1e72b3af75e14.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-archived.json into cache
Downloading http://packagist.org/p/provider-latest%24f29b68abf79eef3ead8a7cb0800cae6435e526ea6036a0b3b50018a8a71791b7.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/p-provider-latest.json into cache
Downloading http://packagist.org/p/pear-pear.php.net/services_libravatar%24104b836f35b4f9f2564a0d8826deb44f72c1d20f3e33c53ec5298dbcfd66f24d.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/provider-pear-pear.php.net$services-libravatar.json into cache
Downloading http://packagist.org/p/cweiske/mime_type_plaindetect%24d7876510349c5130c08372825df71db0a9d5e93aa9bceb76c37b9ae9fdbd7194.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/provider-cweiske$mime-type-plaindetect.json into cache
Downloading http://packagist.org/p/geshi/geshi%2468511d20c4e5e1e7d37d66c1f11ff6bdf40ee4364808cb04521144b165a4a725.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/provider-geshi$geshi.json into cache
Downloading http://packagist.org/p/michelf/php-markdown%2489755a8501fdd34edb7d6f8dcccd00a0f1c104ba48c815a271773ac16e79b8cc.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/provider-michelf$php-markdown.json into cache
Downloading http://packagist.org/p/twig/twig%24cef8d02ebbd6990911a1dd3be2c9c97e69d125a2db963857140f74197d634257.json
Writing /home/<undisclosed-user>/.composer/cache/repo/https---packagist.org/provider-twig$twig.json into cache
Resolving dependencies through SAT
Dependency resolution completed in 0.003 seconds
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package pear-pear.php.net/date_humandiff could not be found in any version, there may be a typo in the package name.
  Problem 2
    - The requested package pear-pear.php.net/http_request2 could not be found in any version, there may be a typo in the package name.
  Problem 3
    - The requested package pear-pear.php.net/pager could not be found in any version, there may be a typo in the package name.
  Problem 4
    - The requested package pear-pear.php.net/openid could not be found in any version, there may be a typo in the package name.
  Problem 5
    - The requested package pear-pear.php.net/services_libravatar could not be found in any version, there may be a typo in the package name.
  Problem 6
    - The requested package pear-pear.php.net/versioncontrol_git could not be found in any version, there may be a typo in the package name.
  Problem 7
    - The requested package cweiske/mime_type_plaindetect could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installing using pear directly seems to have been successful:

~/phorkie$ sudo pear install versioncontrol_git-alpha services_libravatar-alpha http_request2 pager date_humandiff-alpha openid-alpha twig/Twig geshi/geshi zz/mime_type_plaindetect-alpha michelf/Markdown pear2/pear2_services_linkback-alpha
Ignoring installed package pear/http_request2
Did not download optional dependencies: pear/Log, pear/MDB2, pear/HTTP_OAuth, use --alldeps to download automatically
Did not download optional dependencies: pear/System_Command, use --alldeps to download automatically
pear/OpenID can optionally use package "pear/Log"
pear/OpenID can optionally use package "pear/MDB2"
pear/OpenID can optionally use package "pear/HTTP_OAuth" (version >= 0.1.7)
pear2/PEAR2_Services_Linkback requires PHP extension "xmlrpc"
pear/Crypt_DiffieHellman requires PHP extension "bcmath"
pear/Crypt_DiffieHellman can optionally use PHP extension "gmp"
pear/OpenID requires package "pear/Crypt_DiffieHellman"
Starting to download VersionControl_Git-0.4.4.tgz (15,112 bytes)
.....done: 15,112 bytes
downloading Services_Libravatar-0.2.3.tgz ...
Starting to download Services_Libravatar-0.2.3.tgz (9,448 bytes)
...done: 9,448 bytes
downloading Pager-2.5.1.tgz ...
Starting to download Pager-2.5.1.tgz (36,596 bytes)
...done: 36,596 bytes
downloading Date_HumanDiff-0.5.0.tgz ...
Starting to download Date_HumanDiff-0.5.0.tgz (8,128 bytes)
...done: 8,128 bytes
downloading Twig-1.29.0.tgz ...
Starting to download Twig-1.29.0.tgz (106,748 bytes)
...done: 106,748 bytes
downloading geshi-1.0.9.0.tgz ...
Starting to download geshi-1.0.9.0.tgz (Unknown size)
...done: 908,886 bytes
downloading MIME_Type_PlainDetect-0.0.3.tgz ...
Starting to download MIME_Type_PlainDetect-0.0.3.tgz (1,872 bytes)
...done: 1,872 bytes
downloading php-markdown-1.0.2.tgz ...
Starting to download php-markdown-1.0.2.tgz (26,268 bytes)
...done: 26,268 bytes
downloading MIME_Type-1.4.1.tgz ...
Starting to download MIME_Type-1.4.1.tgz (21,807 bytes)
...done: 21,807 bytes
downloading System_Command-1.0.8.tgz ...
Starting to download System_Command-1.0.8.tgz (6,633 bytes)
...done: 6,633 bytes
downloading HTTP2-1.1.2.tgz ...
Starting to download HTTP2-1.1.2.tgz (13,447 bytes)
...done: 13,447 bytes
install ok: channel://pear.php.net/VersionControl_Git-0.4.4
install ok: channel://pear.php.net/Services_Libravatar-0.2.3
install ok: channel://pear.php.net/Pager-2.5.1
install ok: channel://pear.php.net/Date_HumanDiff-0.5.0
install ok: channel://pear.twig-project.org/Twig-1.29.0
install ok: channel://pear.geshi.org/geshi-1.0.9.0
install ok: channel://pear.michelf.com/Markdown-1.0.2
install ok: channel://pear.php.net/MIME_Type-1.4.1
install ok: channel://pear.php.net/System_Command-1.0.8
install ok: channel://pear.php.net/HTTP2-1.1.2
install ok: channel://zustellzentrum.cweiske.de/MIME_Type_PlainDetect-0.0.3
cweiske commented 7 years ago

Current status: