Warning: Cannot modify header information

Talks about solar stuff
Post Reply
jerrymex
Posts: 18
Joined: Fri May 03, 2019 11:56 pm

Warning: Cannot modify header information

Post by jerrymex » Wed Sep 30, 2020 6:52 pm

In my attempt to native install 123solar on raspberry pi 3B,
Linux alarm 5.8.9-2-ARCH #1 SMP Tue Sep 15 00:48:59 UTC 2020 aarch64 GNU/Linux

This error:
Warning: Cannot modify header information - headers already sent by (output started at /srv/http/123solar/styles/globalheader.php:15) in /srv/http/123solar/index.php on line 12

/srv/http/123solar/styles/globalheader.php, line 15 = echo '<!DOCTYPE html>

/srv/http/123solar/index.php, line 12 = header('Location: admin/');

I have not yet hooked up to the inverter, just trying to get things set-up, could this be the issue?
Pointers to how to resolve appreciated.
Thanks

jeanmarc
Posts: 2064
Joined: Thu Aug 29, 2013 7:16 am

Re: Warning: Cannot modify header information

Post by jeanmarc » Wed Sep 30, 2020 7:33 pm

hmm.. maybe change index.php

Code: Select all

include 'config/memory.php';
if (!file_exists($MEMORY)) {
	header('Location: admin/');
} else {
include 'styles/globalheader.php';
}

jerrymex
Posts: 18
Joined: Fri May 03, 2019 11:56 pm

Re: Warning: Cannot modify header information

Post by jerrymex » Wed Sep 30, 2020 8:06 pm

Different error line #
Warning: Cannot modify header information - headers already sent by (output started at /srv/http/123solar/admin/index.php:10) in /srv/http/123solar/admin/index.php on line 119

Here's the modified index.php
<?php
/**
* /srv/http/123solar/index.php
*
* @package default
*/


include 'config/memory.php';
if (!file_exists($MEMORY)) {
header('Location: admin/');
} else {
include 'styles/globalheader.php';
}

jerrymex
Posts: 18
Joined: Fri May 03, 2019 11:56 pm

Re: Warning: Cannot modify header information

Post by jerrymex » Wed Sep 30, 2020 11:57 pm

reinstalled nginx php php-cgi php-fpm, configured, hooked up to the inverter, it works
thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests