I have tried many online examples of using curl_multi_exec. Unfortunately none of them "work" for me, as in they block forever and I never get a response.
- Example 1: http://syframework.alwaysdata.net/curl-multi-exec
- Example 2: http://www.somacon.com/p537.php
I tried modifying the some of the examples so that they will sleep if I get a -1 response which has no effect (other than stopping my CPU going to 100%). I tried both in the CLI and running as a webserver with the same result.
Question: Do these scripts work for other people or do they need modifying/updating for PHP 7.0? Perhaps there is a package other than php7.0-curl that I need to install?
Environment
I am runing PHP 7.0 on Ubuntu 16.04:
PHP 7.0.18-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.18-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies