Post by itk-ra » Mon Jun 27, 2016 5:27 pm

In the shipping-module I get this message upon saving changes:
Warning: Cannot modify header information - headers already sent by (output started at /home/[user]/public_html/shop/admin/language/no-nb/shipping/weight.php:1) in /home/[user]/public_html/shop/system/library/response.php on line 12

The page is then displayed as blank.
Normal users / admin of the shop will think this is an error, allthough the changes are saved.

I have checked the language file (weight.php) does not start with a space (this would invoke this Warning), and that the response-function is free from errors. By disabling the

Code: Select all

exit();
in the function no other errors occur.

Please help me figure this out. I'm kind of stuck.

All the best :)

Newbie

Posts

Joined
Mon Jun 27, 2016 5:05 pm

Post by magikcommerce » Wed Jun 29, 2016 2:13 pm

Solution 1st :
Download the file stated at the error message (i.e file admin/language/no-nb/shipping/weight.php) then apply solution bellow:

step #1. Remove spaces at beginning and end of file.

Code: Select all

<?php //contain space 
echo "remove all space or line-break before <?php and after ?>"; 
?>
step #2. Resave the file with Notepad++ or another editor (encode file as ANSI or UTF-8 without BOM).
step #3. Reupload to server through FTP in ASCII mode, not binary.

--XXX----

Solution 2nd :

step #1 Go to admin folder open index.php
step #2 write ob_start(); at beginning after <?php
step #3 write ob_end_flush(); at end before ?>
and Save file
And your code will look like:

Code: Select all

<?php
ob_start();
// code goes here
ob_end_flush();
?>

Browse large collection of Premium OpenCart Themes


User avatar
New member

Posts

Joined
Mon Feb 09, 2015 5:55 pm
Location - San Jose, CA

Post by straightlight » Wed Jun 29, 2016 7:21 pm

Another alternative solution would be to use the already implemented and used function of:

Code: Select all

if (!headers_sent()) {
    // Argument here.
}
However, this methodology can already be dependable by using the:

Code: Select all

$this->response->addHeader("Your header content here")
where "Your header content here" can be replaced with each lines containing your header envelope content.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by deshoon1 » Mon Sep 26, 2016 11:09 pm

is there a resolution, i get the same error?

User avatar
New member

Posts

Joined
Wed Mar 13, 2013 9:40 am
Who is online

Users browsing this forum: No registered users and 14 guests