phpbrew doesn't (seems) support zmq in its official extension list.
Have to find a way around this issue.
Firstly, turn off phpbrew
phpbrew off
Now using system php.
Next, upgrade system php to 5.6:
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-get update
sudo apt-get install php5
Now, install zmq:
sudo pecl install zmq-beta
After zmq.so created, copy it to the phpbrew directory:
sudo cp /usr/lib/php5/20131226/zmq.so ~/.phpbrew/php/php-5.6.6/lib/php/extensions/no-debug-non-zts-20131226/zmq.so
Bingo! Now I can composer require react/zmq under my project!!
Links:
http://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/