amphp / http-server

An advanced async HTTP server library for PHP, perfect for real-time apps and APIs with high concurrency demands.

Home Page:https://amphp.org/http-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Versions inconsistency? Composer problem

OnkelTem opened this issue · comments

I don't get which version to use and which version docs describe.

If I try the Hello World example from the README with the latest version - it works.
But then I cannot install http-server-router:

  Problem 1
    - Conclusion: remove amphp/dns v1.2.0
    - Conclusion: don't install amphp/dns v1.2.0
    - amphp/http-server v0.8.0 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v0.8.1 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v0.8.2 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v0.8.3 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v1.0.0 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v1.0.1 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v1.1.0 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v1.1.1 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v1.1.2 requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/http-server v1.x-dev requires amphp/socket ^0.10.7 -> satisfiable by amphp/socket[v0.10.10, v0.10.11, v0.10.12, v0.10.13, v0.10.7, v0.10.8, v0.10.9, v0.10.x-dev].
    - amphp/socket v0.10.10 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.11 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.12 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.13 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.7 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.8 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.9 requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - amphp/socket v0.10.x-dev requires amphp/dns ^0.9 -> satisfiable by amphp/dns[v0.9.0, v0.9.1, v0.9.10, v0.9.11, v0.9.12, v0.9.13, v0.9.14, v0.9.15, v0.9.2, v0.9.3, v0.9.4, v0.9.5, v0.9.6, v0.9.7, v0.9.8, v0.9.9, v0.9.x-dev].
    - Can only install one of: amphp/dns[v0.9.0, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.1, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.10, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.11, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.12, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.13, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.14, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.15, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.2, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.3, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.4, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.5, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.6, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.7, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.8, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.9, v1.2.0].
    - Can only install one of: amphp/dns[v0.9.x-dev, v1.2.0].
    - Installation request for amphp/dns (locked at v1.2.0) -> satisfiable by amphp/dns[v1.2.0].
    - Installation request for amphp/http-server-router dev-master -> satisfiable by amphp/http-server-router[dev-master].
    - Conclusion: don't install amphp/http-server dev-master|install amphp/http-server v0.8.0|install amphp/http-server v0.8.1|install amphp/http-server v0.8.2|install amphp/http-server v0.8.3|install amphp/http-server v1.0.0|install amphp/http-server v1.0.1|install amphp/http-server v1.1.0|install amphp/http-server v1.1.1|install amphp/http-server v1.1.2|install amphp/http-server v1.x-dev
    - Conclusion: remove amphp/http-server dev-master|install amphp/http-server v0.8.0|install amphp/http-server v0.8.1|install amphp/http-server v0.8.2|install amphp/http-server v0.8.3|install amphp/http-server v1.0.0|install amphp/http-server v1.0.1|install amphp/http-server v1.1.0|install amphp/http-server v1.1.1|install amphp/http-server v1.1.2|install amphp/http-server v1.x-dev
    - amphp/http-server-router dev-master requires amphp/http-server ^2 || ^1 || ^0.8 -> satisfiable by amphp/http-server[v0.8.0, v0.8.1, v0.8.2, v0.8.3, v1.0.0, v1.0.1, v1.1.0, v1.1.1, v1.1.2, v1.x-dev, v2.0.0-rc1, v2.0.0-rc2, v2.0.0-rc3].
    - Can only install one of: amphp/http-server[v2.0.0-rc1, dev-master].
    - Can only install one of: amphp/http-server[v2.0.0-rc2, dev-master].
    - Can only install one of: amphp/http-server[v2.0.0-rc3, dev-master].
    - Installation request for amphp/http-server (locked at dev-master) -> satisfiable by amphp/http-server[dev-master].

And if I switch to the version 1.1.2, I cannot find a proper documentation bescause the current one is not consistent with the classes. There is no HttpServer class for example and etc.

In the docs of Http Server https://amphp.org/http-server/ there is no any mention about versioning.

Hey @OnkelTem!

  1. Using examples from amphp/http-server (master branch or v2.0.0 RC3) with latest versions of http-server-router (v1.0.2) should be just fine.

I have no composer issues with composer.json like this:

{
    "require": {
        "amphp/http-server": "^2.0",
        "amphp/http-server-router": "^1.0"
    },
    "minimum-stability": "RC"
}
  1. amphp/http-server v2 is still in Release Candidate stage, that's why https://amphp.org/http-server/ documentation is all about version v.1.1

@krlv Unfortunately, the documentation on our website always points to the default branch currently, so master with the changes for RC.

Ok, I got it.
The problem was that I had "minimum-stability": "dev" in my composer.json.
So when I installed amphp/http-server I got:

amphp/http-server      dev-master 02c7697

And afterwards router doesn't install:

$ composer require amphp/http-server-router
Using version dev-master for amphp/http-server-router
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: amphp/http-server[v1.x-dev, dev-master].
    - Can only install one of: amphp/http-server[v1.x-dev, dev-master].
    - Can only install one of: amphp/http-server[v1.x-dev, dev-master].
    - amphp/http-server-router dev-master requires amphp/http-server ^2 || ^1 || ^0.8 -> satisfiable by amphp/http-server[v1.x-dev].
    - Installation request for amphp/http-server-router dev-master -> satisfiable by amphp/http-server-router[dev-master].
    - Installation request for amphp/http-server dev-master -> satisfiable by amphp/http-server[dev-master].

or:

$ composer require amphp/http-server-router:"^1.0.2"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: amphp/http-server[v1.x-dev, dev-master].
    - Can only install one of: amphp/http-server[v1.x-dev, dev-master].
    - Can only install one of: amphp/http-server[v1.x-dev, dev-master].
    - amphp/http-server-router v1.0.2 requires amphp/http-server ^2 || ^1 || ^0.8 -> satisfiable by amphp/http-server[v1.x-dev].
    - Installation request for amphp/http-server-router ^1.0.2 -> satisfiable by amphp/http-server-router[v1.0.2].
    - Installation request for amphp/http-server dev-master -> satisfiable by amphp/http-server[dev-master].

"prefer-stable": true resolved the issue.