Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set response code - headers already sent - richdocumentscode/proxy.php on line 296 #286

Open
derRichter opened this issue Oct 11, 2024 · 1 comment · May be fixed by #293
Open

Cannot set response code - headers already sent - richdocumentscode/proxy.php on line 296 #286

derRichter opened this issue Oct 11, 2024 · 1 comment · May be fixed by #293

Comments

@derRichter
Copy link

derRichter commented Oct 11, 2024

here the same error. i wondered me to, what is the reason to close this bug without answer or fix?

get error:
PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296

updated the App Collabora Online - Built-in CODE Server
to Version 24.4.802, APACHE-lizensiert

full reboot the hole server

error and bug, still exist!

[Fri Oct 11 21:11:34.793313 2024] [php:warn] [pid 1372:tid 1372] [client 127.0.0.1:43290] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:11:34.836664 2024] [php:warn] [pid 952:tid 952] [client 127.0.0.1:43302] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:11:51.693984 2024] [php:warn] [pid 1322:tid 1322] [client 192.168.241.114:51304] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:11:51.746316 2024] [php:warn] [pid 1648:tid 1648] [client 192.168.241.114:51330] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:12:35.017129 2024] [php:warn] [pid 952:tid 952] [client 127.0.0.1:60412] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:12:35.058245 2024] [php:warn] [pid 955:tid 955] [client 127.0.0.1:60438] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:12:52.297829 2024] [php:warn] [pid 1648:tid 1648] [client 192.168.241.114:52196] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:12:52.343857 2024] [php:warn] [pid 1075:tid 1075] [client 192.168.241.114:52214] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:13:35.243662 2024] [php:warn] [pid 955:tid 955] [client 127.0.0.1:49072] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:13:35.286355 2024] [php:warn] [pid 957:tid 957] [client 127.0.0.1:49090] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:13:52.818719 2024] [php:warn] [pid 1075:tid 1075] [client 192.168.241.114:41398] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:13:52.866121 2024] [php:warn] [pid 1326:tid 1326] [client 192.168.241.114:41428] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296 [Fri Oct 11 21:14:35.469759 2024] [php:warn] [pid 957:tid 957] [client 127.0.0.1:55310] PHP Warning: http_response_code(): Cannot set response code - headers already sent (output started at /var/www/nextcloud/apps/richdocumentscode/proxy.php:289) in /var/www/nextcloud/apps/richdocumentscode/proxy.php on line 296

@giox069
Copy link

giox069 commented Oct 31, 2024

As I just wrote into #270, the problem is that http_response_code() is called after some "print". The error is logged in webserver error log, but if you have display_errors enabled in php.ini, the error is sent with the browser response, and the browser can no longer proceed in opening documents.
My solution was to edit proxy.php, delete the two http_response_code(200) lines, and move the http_response_code(400) line before the print instructions. It seems to work. I could make a PR in the future, but I'm not an official devel.

giox069 added a commit to giox069/richdocumentscode that referenced this issue Nov 2, 2024
Calling http_response_code() after print() has no effect and it logs a warning "headers already sent" on the web server logs. When PHP has display_errors enabled, the warning is also sent as a response to the browser, and the browser is unable to open CODE application.
This commit fixes CollaboraOnline#286 and CollaboraOnline#270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants