Closed andrei-dascalu closed 4 years ago
Hello @andrei-dascalu ,
The documentation is a bit outdated, I have to update it. The latest version of Uniquity devtools allows you to start your project like following:
Ubiquity serve -t=roadrunner
Required dependencies, including RoadRunner binary will be downloaded automatically and server will be started.
The prerequisite is only php-cgi installation.
@Lapinskas Awesome! Indeed, most of the things just work when using Ubiquity
The second part (regarding Admin) still persists though:
INFO[0011] 127.0.0.1 {95.5ms} 200 GET http://127.0.0.1:8095/
INFO[0067] 127.0.0.1 {125ms} 500 GET http://127.0.0.1:8095/Admin worker error: invalid data found in the buffer (possible echo)
WARN[0127] worker.50124 killed
ERRO[0127] worker.50124 signal: killed
This is out of the box setup, running serve with roadrunner, accessing index page and following the Admin link. When using this serve command via Ubiquity tool, it doesn't seem that PHP errors/notices/warnings/etc get logged (but I assume I can pass rr parameters as well, I will try later).
@Lapinskas I think the main issue is in the process of being solved on framework side, will close this. Thanks!
Hi @andrei-dascalu,
The issue is in UbiquityMyAdmin as you already figured-out, specifically in this lines:
ob_end_flush();
}
It flushes all buffers, including buffer that 'wraps' Ubiquity and serves as an interceptor to send data to RoadRunner and not to the standard output.
Some technical details: Ubiquity does not support PSR-7 for the performance reasons, so the only way to 'intercept' the HTTP output and send it to the RoadRunner is to use buffers. (That's why we need php-cgi, as php discard headers, while php-cgi preserve it). However, if all levels of buffers are flushed, including the wrapper, I can do nothing with that.
I have seen that the fix already present from Ubiquity side. Thank you for your interest and the bug report!
Hello,
After following setup instructions, I am facing a number of warnings & notices:
The issues seems to be:
.ubiquity
(should it be there? there is one inapp/config
folder - but it seems another config is needed though there's no sample/indication as to what it should do)$config ["siteUrl"] = 'http://'.$sConfig['host'].':'.$sConfig['port'].'/';
in the generated worker file tries to buildsiteUrl
which is defined as-is inapp/config/config.php
from 2 keys that don't exist in config.I am not entirely sure what would be the proper way to deal with this. Should there be a host and port in the config.php? There are already settings in .rr.yml with respect to the port (which should match at least in local). Does it make sense to have separate port/host ? In this case this needs to be handled in 3 separate files.
Also, using the Admin (after following instructions) results in the following
Seems there's a flush there that breaks the way Roadrunner expects things to work.