Your requirements cannot be resolved to an installed set of packages.

Sorry for duplicating this question to others. I can not solve my problem.

I am working on a project based on Ratchet. I'm trying to run Push Integration. So, to run, I have to use the composer to get some dependencies. I am making a composer.json file as shown below:

{
    "autoload": {
        "psr-0": {
            "MyApp": "src"
        }
    },
    "require": {
        "cboden/ratchet": "0.3.*",
        "react/zmq": "0.2.*|0.3.*"
    }
}

When I execute the composer on it, the error below appears:

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - react/zmq v0.3.0 requires ext-zmq * -> the requested PHP extension zmq is missing from your system.
    - react/zmq v0.2.0 requires ext-zmq * -> the requested PHP extension zmq is missing from your system.
    - Installation request for react/zmq 0.2.*|0.3.* -> satisfiable by react/zmq[v0.2.0, v0.3.0].

Below you can find the .json composer from Ratchetand ZMQ:

ZMQ:

{
    "name": "react/zmq",
    "description": "ZeroMQ bindings for React.",
    "keywords": ["zmq", "zeromq"],
    "license": "MIT",
    "require": {
        "php": ">=5.4.0",
        "ext-zmq": "*",
        "evenement/evenement": "~2.0",
        "react/event-loop": "0.4.*"
    },
    "require-dev": {
        "ext-pcntl": "*"
    },
    "autoload": {
        "psr-0": { "React\\ZMQ": "src" }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "0.4-dev"
        }
    }
}

Ratchet:

{
    "name": "cboden/ratchet"
  , "type": "library"
  , "description": "PHP WebSocket library"
  , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets"]
  , "homepage": "http://socketo.me"
  , "license": "MIT"
  , "authors": [
        {
            "name": "Chris Boden"
          , "email": "cboden@gmail.com"
          , "role": "Developer"
        }
    ]
  , "support": {
        "forum": "https://groups.google.com/forum/#!forum/ratchet-php"
      , "issues": "https://github.com/ratchetphp/Ratchet/issues"
      , "irc": "irc://irc.freenode.org/reactphp"
    }
  , "autoload": {
        "psr-0": {
            "Ratchet": "src"
        }
    }
  , "require": {
        "php": ">=5.3.9"
      , "react/socket": "0.3.*|0.4.*"
      , "guzzle/http": "~3.6"
      , "symfony/http-foundation": "~2.2"
      , "symfony/routing": "~2.2"
    }
}

What's wrong? Please give me a solution. Thanks in advance:)

+4
source share
2 answers

OK, here we go ...

ZMQ ZMQ, . Debian Linux, .

-: 0MQ: http://zeromq.org/area:download , POSIX tarball Stable Release 4.0.4.

~$ tar -xvf zeromq-4.0.4.tar
~$ cd zeromq-4.0.4
~$ ./configure
~$ make
~$ sudo make install

, ZMQ zmq php binding... , php-dev php pear. :

~$ sudo apt-get install php5-dev php-pear
~$ sudo pecl install zmq-beta

, ZMQ php (ext-php), " = zmq.so" ( = php_zmq.dll windows) php.ini: :

~$ sudo nano /etc/php5/apache2/php.ini

: PHP - 5.4.x( 5.4+, ...), zmq.ini /etc/php 5/conf.d "extension = zmq.so":

~$ sudo nano /etc/php5/conf.d/20-zmq.ini

HTTP- Reloadind ( apache):

~$  sudo service apache2 reload

WOW!!! :

~$ composer --verbose update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing react/zmq (v0.3.0)
    Downloading: 100%         
    Extracting archive

Writing lock file
Generating autoload files
+16

, - php.ini, composer.
ini CLI PHP.

php --ini , :

enter image description here

.ini , /etc/php5/apache2/php.ini. , /etc/php5/cli/php.ini extension=zmq.so , , .

, the requested PHP extension zmq is missing .

+11

Source: https://habr.com/ru/post/1547402/


All Articles