Page 1 of 2
'Headers already sent' error messages
Posted: Fri Feb 28, 2014 11:47 pm
by tday
Really liked the demo (great succinct tutorials!) and want to give nuBuilder a try.
The install on a remote host (Hostpapa) went fine until it came to loading nuinstall.php. This gave 'headers already sent' messages. Also tried on local xampp server (PHP 5.3.0) with the same outcome
After googling the problem , I edited nuinstall.php by moving 'Session Start' to the top of page - this worked and I could then create the database. But then index.php gave similar 'headers already sent' error messages.
Rather than attempting more edits, could these error messages be related to a PHP version issue or maybe parameter setting somewhere?
Re: 'Headers already sent' error messages
Posted: Sun Mar 02, 2014 3:44 pm
by hans
Hi,
I've got the same problem.
I renamed session_start(); to @session_start();
in nucommon.php but that only suppresses the error messages.
It's no solution.
Don't know if this problem is also the cause of any other problems?
Hans.
Re: 'Headers already sent' error messages
Posted: Thu Mar 06, 2014 2:06 pm
by vnbuser
Hi!
I have the same issue here with a webhost (Linux, Apache, PHP Version 5.2.17).
I tried to re-install and google the issue but it seems that the session should be started before pushing HTML.
But then, why doesn't everyone have the issue?
Kind regards,
Joe
Re: 'Headers already sent' error messages
Posted: Thu Mar 06, 2014 3:14 pm
by hans
vnbuser wrote:Hi!
I have the same issue here with a webhost (Linux, Apache, PHP Version 5.2.17).
But then, why doesn't everyone have the issue?
To my opinion: it's a blocking issue??
Howto debug this?
Hans.
Re: 'Headers already sent' error messages
Posted: Thu Mar 06, 2014 4:41 pm
by vnbuser
Howto debug this?
Hans,
Edit index.php and insert
Code: Select all
<?php
require_once('config.php');
require_once('nucommon.php');
?>
as the first two lines. Remove line 18 and 19.
That seems to do the trick for me. Again, I don't understand why not everyone has this issue.
Kind regards,
Joe
Re: 'Headers already sent' error messages
Posted: Thu Mar 06, 2014 7:58 pm
by hans
Hi Joe,
That solved the first problem.
Thanks.
(2nd step I suggest is to create a form with the Form Wizard?)
Re: 'Headers already sent' error messages
Posted: Thu Jun 12, 2014 2:10 pm
by gavinjb
Hi,
I have just installed nuBuilder and I am getting this error (on both the nuinstall.php index.php pages), I have tried the fix above and I get the following error
Code: Select all
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/sites/f/mydomain.com/public_html/index.php:11) in /var/sites/f/mydomain.com/public_html/nucommon.php on line 5
my Index.php is as follows
Code: Select all
<?php
require_once('config.php');
require_once('nucommon.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>nuBuilder</title>
<link rel="apple-touch-icon" href="apple-touch-icon.png"/>
<link rel="stylesheet" href="jquery/jquery-ui.css" />
<script src="jquery/jquery-1.8.3.js" type='text/javascript'></script>
<script src="jquery/jquery-ui.js" type='text/javascript'></script>
<?php
jsinclude('nuformat.js');
jsinclude('nucalendar.js');
jsinclude('nucommon.js');
jsinclude('nueditform.js');
jsinclude('nubrowseform.js');
print $GLOBALS['nuSetup']->set_css; //-- html header
$i = "";
$h = "";
$t = "";
$u = isset($_GET['u']) ? $_GET['u'] : '';
$p = isset($_GET['p']) ? $_GET['p'] : '';
if( array_key_exists('i', $_GET) ) {
$i = $_GET['i'];
}
if( array_key_exists('home', $_SESSION) ) {
$h = $_SESSION['home'];
}
if( array_key_exists('title', $_SESSION) ) {
$t = $_SESSION['title'];
}
$l = nuGetLanguage();
$de = $GLOBALS['nuSetup']->set_denied;
print "
<style>
.nuSelected {cursor:move;outline:2px solid red}
</style>
<script>
window.nuDenied = '$de';
window.nuUsername = '$u';
window.nuPassword = '$p';
$l
function nuGetID(){
return '$i';
}
function nuGetHome(){
return '$h';
}
function nuGetTitle(){
return '$t';
}
function nuHomeWarning(){
if(nuFORM.edited == '1'){
return nuTranslate('Leave This Form Without Saving?')+' '+nuTranslate('Doing this will return you to the login screen.');
}
return nuTranslate('Doing this will return you to the login screen.');
}
function nuWindowWarning(){
if(nuFORM.edited == '1'){
return nuTranslate('Leave This Form Without Saving?');
}
return null;
}
window.onbeforeunload = nuHomeWarning;
</script>
";
?>
<script>
window.nuShiftKey = false;
window.nuControlKey = false;
window.nuTimeout = false;
window.nuMoveable = false;
$(document).ready(function() {
$('title').html(nuGetTitle());
var i = nuGetID();
window.nuSession = new nuBuilderSession();
if(i === ''){ //-- Main Desktop
if(window.nuUsername == '' && window.nuPassword == ''){
toggleModalMode();
}else{
nuLogin(window.nuUsername, window.nuPassword);
}
}else{ //-- iFrame or new window
var pSession = nuGetParentSession();
nuSession.setSessionID(pSession.nuSessionID);
var w = document.defaultView.parent.nuSession.getWindowInfo(i,pSession);
//-- added by sc 2014-01-24
var alreadyDefined = Array();
for (var key in w){
alreadyDefined.push(key);
}
for (var key in document.defaultView.parent.nuFORM){
if(alreadyDefined.indexOf(key) == -1){
w[key] = document.defaultView.parent.nuFORM[key]; //-- add values from parent values (so they can be used as hash variables)
}
}
//-- end added by sc
nuBuildForm(w); //-- Edit or Browse
}
});
</script>
</head>
<body onkeydown="nuKeyPressed(event, true);" onkeyup="nuKeyPressed(event, false);">
</body>
</html>
Can anyone help?
Thanks,
Gavin
Re: 'Headers already sent' error messages
Posted: Tue Jun 23, 2015 7:10 pm
by micmc
Yeah it looks like that last post is the solution.
I've came here at first looking for that error message and looking at the DATES involved with the issue (one year ago) I still posted a request, because apparently this issue is still there after one year.
This is a bit of what I'm clueless about, why the files I download today are not fixed as stated above after all that time?
Might have been one left out by admin
Thanks to all anyway.
Re: 'Headers already sent' error messages
Posted: Wed Jul 15, 2015 11:52 am
by hans
Installed nuBuilder approx. a year ago and it didn't work properly.
My hostingprovider upgraded to the latest of php and mysql.
Problem is, after a year?, still not solved.
Could it be that my hosting is on a 32Bit machine?
I applied the workaround and the error is gone.
Re: 'Headers already sent' error messages
Posted: Thu Jul 30, 2015 7:08 am
by shane
I signed up with
http://www.hostpapa.com/ and uploaded the latest download from
https://github.com/nuSoftware/nuBuilder ... master.zip
and I found the same error.
I have now updated index.php to fix this.
you can patch the file from this link:
https://github.com/nuSoftware/nuBuilder ... /index.php
Please let me know if there are any other problems related to this.