Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with understanding error message

Featured Replies

Hi,

I know that this error message comes many times and the problem is that we echo or print something out on the page before header().

 

I have installed phpbb on my server it added a database, everything is fine. Then I would like to add the classifieds module. I have followed the instructions. Basically, I had to include a file of the ads mod constants into the constants.php, then added some links to the template. It all made sense.

But now, I get this message.

 

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\xampp\htdocs\phpBB2\ads_mod\ads_constants.php:54) in C:\xampp\xampp\htdocs\phpBB2\includes\sessions.php on line 254

 

On line 254 of session.php it wants to send a cookie, but it can not, because it has benn sent on ine 54 of ads_constants.php. BUT!!! in line 54 of ads_constants.php it is the end of the script. " ?> " This is there!!!

 

Please, help if you have any idea of what can be wrong!

Watch out for odd spaces that have been sent.

Sometimes, even a space before the first ' <%php' or in your case probably between the first bit of php code and the second bit.

  • Author

Watch out for odd spaces that have been sent.

Sometimes, even a space before the first ' <%php' or in your case probably between the first bit of php code and the second bit.

I have checked the spaces and there are none. I have an idea but I might be wrong. There are several messages like: "die('Hacking attempt')"

or " message_die(GENERAL_MESSAGE, $message)"

 

Can these cause the problem if they are triggered?

I can not see exactly these, but I just did something for fun... I copied and pastes the whole content of ads_constants.php in constants.php. It should be the same as include isn't it?

The header errors disappeared from the firt page and thousand of other erro messages came up eg "message_die(GENERAL_MESSAGE, $message)"

So something must be wrong it can not access a folder and tables... as I saw, it exseeds my experience and knowledge to solve this...

Usually you can see the problem by looking at the source of the rendered page. If there is any HTML whatsoever before the error message, that should put you on the right track.

 

The problem probably isn't the die() call you mention, because that would stop PHP dead in its tracks, so PHP would never try to send the header, so you would never see an error message :)

On line 254 of session.php it wants to send a cookie, but it can not, because it has benn sent on ine 54 of ads_constants.php. BUT!!! in line 54 of ads_constants.php it is the end of the script. " ?> " This is there!!!

Are you absolutely sure that there is no space or newline after the " ?> " because I can see one.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.