PHP Classes

Cannot install via composer

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Cannot install via composer  >  (Un) Subscribe thread alerts  
Subject:Cannot install via composer
Summary:Always fails trying to download sasl.zip?
Messages:13
Author:Mike
Date:2020-01-21 18:24:50
 
  1 - 10   11 - 13  

  1. Cannot install via composer   Reply   Report abuse  
Picture of Mike Mike - 2020-01-21 18:24:50
[Composer\Downloader\TransportException]
The "https://www.phpclasses.org/install/package/sasl.zip" file could not be downloaded (HTTP/1.0 404 it was not specified a valid package)

Why is composer trying to download sasl.zip?

How else can I install this oauth client, other than composer?

Please, advise. Thank you.

~ Mike

  2. Re: Cannot install via composer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-01-21 19:21:05 - In reply to message 1 from Mike
The SASL package may be needed by the HTTP client package to perform authentication.

In the download page of the OAuth package there are instructions about what you should put in the composer.json file to install the OAuth packages and other dependencies available in the PHP Classes site. Then you may need to use a password mentioned in that tab.

Did you add something like this to your composer file?

{
"require":
{
"phpclasses/oauth-api": ">=1.0.105"
},
"repositories":
[
{
"type": "composer",
"url": "https:\/\/www.phpclasses.org\/"
},
{
"packagist": false
}
]
}

  3. Re: Cannot install via composer   Reply   Report abuse  
Picture of Mike Mike - 2020-01-21 19:29:07 - In reply to message 2 from Manuel Lemos
Yes.

I copied-pasted exactly what you have on this page:

phpclasses.org/package_repositories ...

I even tried adding sasl:

"require": {
"phpclasses/oauth-api": ">=1.0.105",
"phpclasses/sasl": ">=1.0"
},

Same error every time.

  4. Re: Cannot install via composer   Reply   Report abuse  
Picture of Mike Mike - 2020-01-21 19:32:07 - In reply to message 3 from Mike
It's interesting that it's a 404 Not Found - since going to it in a browser works OK:

phpclasses.org/install/package/sasl ...

  5. Re: Cannot install via composer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-01-21 20:17:28 - In reply to message 4 from Mike
I just tried it here and using your PHP Classes user and the password supplied on the page above it works for downloading the package again.

Are you defining your Composer password user name and password like it is described in this article?

phpclasses.org/blog/post/221-Speedu ...

  6. Re: Cannot install via composer   Reply   Report abuse  
Picture of Mike Mike - 2020-01-21 20:32:04 - In reply to message 5 from Manuel Lemos
It wasn't exactly that.

Now, it is:
{
"config":
{
"basic-auth":
{
"www.phpclasses.org":
{
"username": "_____",
"password": "_____"
}
}
}
}

[Composer\Downloader\TransportException]
The "https://www.phpclasses.org/install/package/sasl.zip" file could not be downloaded (HTTP/1.0 404 it was not specified a valid package)


  7. Re: Cannot install via composer   Reply   Report abuse  
Picture of Mike Mike - 2020-01-21 20:40:09 - In reply to message 6 from Mike
FYI:

[transfer_user@russell /opt/oauth2] $ cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)

[transfer_user@russell /opt/oauth2] $ /usr/bin/php -v
PHP 5.6.40 (cli) (built: Oct 22 2019 09:33:23)

[transfer_user@russell /opt/oauth2] $ /bin/composer -V
Composer version 1.9.0 2019-08-02 20:55:32

[transfer_user@russell /opt/oauth2] $ ls -alR
.:
total 12
drwxr-xr-x 3 transfer_user transfer_group 76 Jan 21 14:35 .
drwxr-xr-x. 5 root root 50 Jan 21 12:48 ..
-rw-r--r-- 1 transfer_user transfer_group 184 Jan 21 14:29 auth.json
-rw-r--r-- 1 root root 138 Jan 21 14:27 auth.json_____
-rw-r--r-- 1 transfer_user transfer_group 214 Jan 21 14:33 composer.json
drwxr-xr-x 3 transfer_user transfer_group 23 Jan 21 12:49 vendor

./vendor:
total 0
drwxr-xr-x 3 transfer_user transfer_group 23 Jan 21 12:49 .
drwxr-xr-x 3 transfer_user transfer_group 76 Jan 21 14:35 ..
drwxr-xr-x 2 transfer_user transfer_group 6 Jan 21 14:33 phpclasses

./vendor/phpclasses:
total 0
drwxr-xr-x 2 transfer_user transfer_group 6 Jan 21 14:33 .
drwxr-xr-x 3 transfer_user transfer_group 23 Jan 21 12:49 ..

[transfer_user@russell /opt/oauth2] $ /bin/composer install -vvv
Reading ./composer.json
Loading config file ./composer.json
Loading config file /opt/oauth2/auth.json
Reading /opt/oauth2/auth.json
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
...

  8. Re: Cannot install via composer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-01-22 18:04:22 - In reply to message 7 from Mike
I just installed the OAuth package from scratch using the instructions of this page and it worked.

phpclasses.org/blog/post/221-Speedu ...

I also used the composer.json file with he contents below. Can you try doing exactly this and remove the auth.json file you created? composer will create that file for you after you enter your user name and the password that is in the other page.

phpclasses.org/package_repositories ...

If it does not work for you, there may be an issue with your PHP or composer installation, maybe with the availability of a zip decompression support. In that case, can you copy the output of composer and paste in your response here?

{
"require":
{
"phpclasses/oauth-api": ">=1.0.105"
},
"repositories":
[
{
"type": "composer",
"url": "https:\/\/www.phpclasses.org\/"
},
{
"packagist": false
}
]
}

  9. Re: Cannot install via composer   Reply   Report abuse  
Picture of Mike Mike - 2020-01-22 18:55:52 - In reply to message 8 from Manuel Lemos
[transfer_user@russell /opt/oauth_2] $ cat composer.json
{
"require":
{
"phpclasses/oauth-api": ">=1.0.105"
},
"repositories":
[
{
"type": "composer",
"url": "https:\/\/www.phpclasses.org\/"
},
{
"packagist": false
}
]
}


[transfer_user@russell /opt/oauth_2] $ /bin/composer install -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Executing command (/opt/oauth_2): git branch --no-color --no-abbrev -v
Executing command (/opt/oauth_2): git describe --exact-match --tags
Executing command (/opt/oauth_2): git log --pretty="%H" -n1 HEAD
Executing command (/opt/oauth_2): hg branch
Executing command (/opt/oauth_2): fossil branch list
Executing command (/opt/oauth_2): fossil tag list
Executing command (/opt/oauth_2): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /home/transfer_user/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Running 1.9.0 (2019-08-02 20:55:32) with PHP 5.6.40 on Linux / 3.10.0-957.1.3.el7.x86_64
Loading composer repositories with package information
Downloading https://www.phpclasses.org/packages.json using proxy tcp://squid-awsisland.provell.com:3128
Writing /home/transfer_user/.cache/composer/repo/https---www.phpclasses.org/packages.json into cache
Updating dependencies (including require-dev)
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.000 seconds
Analyzed 4894 packages to resolve dependencies
Analyzed 67 rules to resolve dependencies
Package operations: 3 installs, 0 updates, 0 removals
Installs: phpclasses/sasl:1.0.0, phpclasses/httpclient:1.0.5, phpclasses/oauth-api:1.0.105
- Installing phpclasses/sasl (1.0.0): Downloading https://www.phpclasses.org/install/package/sasl.zip using proxy tcp://squid-awsisland.provell.com:3128
Downloading (failed)
Failed: [Composer\Downloader\TransportException] 404: The "https://www.phpclasses.org/install/package/sasl.zip" file could not be downloaded (HTTP/1.0 404 it was not specified a valid package)

[Composer\Downloader\TransportException]
The "https://www.phpclasses.org/install/package/sasl.zip" file could not be downloaded (HTTP/1.0 404 it was not specified a valid package)

Exception trace:
() at /usr/share/php/Composer/Util/RemoteFilesystem.php:440
Composer\Util\RemoteFilesystem->get() at /usr/share/php/Composer/Util/RemoteFilesystem.php:89
Composer\Util\RemoteFilesystem->copy() at /usr/share/php/Composer/Downloader/FileDownloader.php:153
Composer\Downloader\FileDownloader->doDownload() at /usr/share/php/Composer/Downloader/FileDownloader.php:97
Composer\Downloader\FileDownloader->download() at /usr/share/php/Composer/Downloader/ArchiveDownloader.php:38
Composer\Downloader\ArchiveDownloader->download() at /usr/share/php/Composer/Downloader/ZipDownloader.php:77
Composer\Downloader\ZipDownloader->download() at /usr/share/php/Composer/Downloader/DownloadManager.php:216
Composer\Downloader\DownloadManager->download() at /usr/share/php/Composer/Installer/LibraryInstaller.php:197
Composer\Installer\LibraryInstaller->installCode() at /usr/share/php/Composer/Installer/LibraryInstaller.php:101
Composer\Installer\LibraryInstaller->install() at /usr/share/php/Composer/Installer/InstallationManager.php:173
Composer\Installer\InstallationManager->install() at /usr/share/php/Composer/Installer/InstallationManager.php:160
Composer\Installer\InstallationManager->execute() at /usr/share/php/Composer/Installer.php:597
Composer\Installer->doInstall() at /usr/share/php/Composer/Installer.php:229
Composer\Installer->run() at /usr/share/php/Composer/Command/InstallCommand.php:122
Composer\Command\InstallCommand->execute() at /usr/share/php/Symfony/Component/Console/Command/Command.php:259
Symfony\Component\Console\Command\Command->run() at /usr/share/php/Symfony/Component/Console/Application.php:849
Symfony\Component\Console\Application->doRunCommand() at /usr/share/php/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:267
Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:124
Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:106
Composer\Console\Application->run() at /usr/bin/composer:62

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...


NOTE[1]: We have used composer on this host to install other applications, including AWS PHP API, which we are using successfully.

NOTE[2]: This morning, I used composer on this host to install a Packagist app: composer require league/oauth2-client. Although it's installed, I haven't got it working yet, and your interface looks easier.

NOTE[3]: This host is on AWS, and using a proxy (squid-awsisland.provell.com:3128), also on AWS. I have logged onto that proxy and successfully retrieved the sasl.zip package:

[ms50013@squid-awsisland ~] $ wget --password _____ --user _____ https://www.phpclasses.org/install/package/sasl.zip

  10. Re: Cannot install via composer   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2020-01-22 21:53:56 - In reply to message 9 from Mike
Well if it works for me and it does not work for you, it seems there is something different in your PHP and Composer setup that is different.

One thing that comes to mind is that I tried the latest version of composer. If you are not using the latest version, you may want to try downloading and using that version.

The composer output to get the version number is:

Composer version 1.9.2 2020-01-14 16:30:31

Can you try this version and let me know if it worked?

 
  1 - 10   11 - 13  
For more information send a message to info at phpclasses dot org.