1

I'm creating a plugin for joomla and it is working as expected in my local Windows 7 machine with WAMP. But when I load the plugin into the production server(Debian), I get this warning (not always):

Warning: Cannot modify header information - headers already sent by (output started at /httpdocs/plugins/system/fiuser.php:1) in /httpdocs/plugins/system/jat3/core/parameter.php on line 73

I tried googling, but it didn't helped me solve the problem actually.

<?php

defined('_JEXEC') or die('Restricted Access');

class plgSystemFiUser extends JPlugin {

    // Some functions

}

I get this warning whenever I delete the browsing data from the browser and then the problem persists until I close the browser or go to an another site.

Content of line 73, parameter.php:

setcookie ($this->template.'_tpl', $this->template, $exp, '/');

I'm finding it difficult to debug this problem, as I'm not too much experienced with Joomla and PHP, so any help is appreciated a lot.

jithujose
  • 551
  • 3
  • 15

2 Answers2

0

There is a conflict of the header() method, take a look at flushing the output buffer

PHP.net Output Buffer methods

a.stgeorge
  • 304
  • 1
  • 7
0

Remove the closing ?> tag at the end of your PHP files. It actually serves no useful purpose as the PHP interpreter knows that end-of-file means end-of-PHP too. Removing it means that any extra blank characters added by your editor will have no effect on the output generated and so will not prevent additional HTTP headers from being sent.

Turn output_buffering setting on php.ini to on to permanently remove this error

Manish Trivedi
  • 3,481
  • 5
  • 23
  • 29
  • All of my files are without the closing tag. Anyway, tomorrow I will try changing the output_buffering setting and let you know the result. Thanks for being patient. – jithujose Mar 01 '11 at 19:06
  • Thank you @Manish Trivedi Setting output_buffering = 4096 in the php.ini file helped me solve the problem. – jithujose Mar 02 '11 at 09:31