Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.6k views
in Q2A Core by

I see some warnings in error_log while asking a new question (i think it occurs right after searching for similar questions in the question title input):

[26-Dec-2015 23:17:09 Europe/Istanbul] PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /home/xxx/public_html/okul/qa-include/ajax/asktitle.php:76) in /home/xxx/public_html/okul/qa-include/app/users.php on line 146

[26-Dec-2015 23:17:09 Europe/Istanbul] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/okul/qa-include/ajax/asktitle.php:76) in /home/xxx/public_html/okul/qa-include/app/users.php on line 183

Q2A version: 1.7.2
by
What is your URL? Website?

2 Answers

+1 vote
by
Those particular errors are occurring because some content is being output before session_start is called (when the user auth is set up). Probably a different warning or notice.

You would be able to see this by looking in the Network tab of the browser dev tools. There will be a response that starts with "QA_AJAX_RESPONSE".

If you're able to consistently reproduce this, see if you can find the warning there. Also try removing all non-default plugins to see if the warning comes from one of those.
by
I renamed qa-plugin to qa-plugin-temp and created an empty qa-plugin folder. It seems all plugins are disabled this way. I did what you suggested but could not see the "QA_AJAX_RESPONSE". It says "POST - 200 - xhr - jquery-1.11.3.min.js:5" and no warnings-errors right after I enter a title for the question and the auto search is executed.
by
If you click on the request (e.g. the line where it says "/" which should be at the bottom) it will show this information on the right side. Click the Response tab.
by
QA_AJAX_RESPONSE
1

<div class="qa-ask-similar">
...HTML...
</div>

Just this.

Form data shows:

title:test
qa:ajax
qa_operation:asktitle
qa_root:./
qa_request:ask
by
Are you still getting the original warnings in your logs after removing the plugins? Because if there are no warnings now, that means the problem is due to a plugin.
by
Still getting them. I'll install a demo version and test it on the server.
by
Same problem started to appear at my production installation. Weird. Cannot remember to have put any plugins. Could it be again a new browser like IE Edge (?) that is causing such problems? The ajax response is fine trying it in Firefox.
by
Bump, happens again on a new server!
by
Seems to be a bug, reported here as well (qa-include/ajax/asktitle.php:76):
http://www.question2answer.org/qa/44404/
http://www.question2answer.org/qa/48672/
http://www.question2answer.org/qa/48414/

Problem could be the "mysql connection limit".
+2 votes
by

Fixed by https://github.com/q2a/question2answer/issues/440

Add 

     $userid = qa_get_logged_in_userid();

in the beginning of asktitle.php

...