Closed dejanmilosevic0 closed 7 years ago
Hi @demil! I'm not sure I follow what you're trying to do and what your issue is, as it's a bit unclear what you're trying to achieve from the description you've posted.
May I ask you provide a simple gist of what you're trying to achieve? Thanks!
https://gist.github.com/demil/a1d0b8526f77f502edebf6c68cebc60a
When i run this file in php_cli - php test_react_docker.php
i get: test1 containers array test2
but when i run it over http - for example domain.com/test_react_docker.php
i get only:
test1 test2
with no containers array.
Which user is running this script via CLI and which one is running this via your webserver? You will most likely use different users where one may not have access the the underlying socket file (docker
group for www-data
?).
Note that you should get some error output if you use done()
instead of then()
or pass a second function to each which should receive an Exception
object.
I hope this helps :+1:
I am using root user for both cases. it is testing env.
Note that you should get some error output if you use done() instead of then() or pass a second function to each which should receive an Exception object.
Have you tried this and received any error output?
I have tried everthing, hhvm, php-fpm, root user, nginx user, www-data user, 2 servers, and i am geting same sympthoms, on client output is containers array on http only echo outputs.
ok, i now have changed then() to done() and i am getting:
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to connect to unix domain socket path: Permission denied' in /vendor/react/http-client/src/Request.php on line 172
but my user is in docker group and everything works fine from user client
I would suggest you double-check your user configuration works as expected and things are actually executed as root
. Given that this is a "testing env"; you may as well use chmod 777
on the socket path.
It wokrs fine with 777, but that is nuclear solution. Thank you for your support and best regards.
If ia use php-cli i get api response, but if i use http over php-fpm pointed to same file i get nothing.
What am i missing?