Title: Cannot modify headers information
Last modified: October 23, 2017

---

# Cannot modify headers information

 *  Resolved [tomlandis](https://wordpress.org/support/users/tomlandis/)
 * (@tomlandis)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-headers-information/)
 * I am getting the error below, not too sure why. My code says:
 * if (!isset($_SESSION)) if (session_start());
 * (This is triggered by a snippet.)
    —- ERROR:
 * Warning: Cannot modify header information – headers already sent by (output started
   at /opt/bitnami/apps/wordpress/htdocs/wp-includes/formatting.php:5079) in /opt/
   bitnami/apps/wordpress/htdocs/wp-content/plugins/wp-native-php-sessions/callbacks.
   php on line 35
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcannot-modify-headers-information%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [tomlandis](https://wordpress.org/support/users/tomlandis/)
 * (@tomlandis)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-headers-information/#post-9613882)
 * Accidental double-post, sorry
 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-headers-information/#post-9616292)
 * Hi [@tomlandis](https://wordpress.org/support/users/tomlandis/),
 * Can you share the snippet of code you’re using to start the session? What WordPress
   action is it being called on?
 * Also, can you try reproducing the issue in a non-Bitnami environment to see if
   it might be specific to your environment?
 *  Thread Starter [tomlandis](https://wordpress.org/support/users/tomlandis/)
 * (@tomlandis)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-headers-information/#post-9616713)
 * Hi Daniel,
 * The snippet is `[phpinclude file='/opt/bitnami/apache2/htdocs/abc/index.php']`
   which is a simple plugin that includes the file. It is triggered in the body 
   of the page.
 * And index.php contains the line:
 * `if (!isset($_SESSION)) session_start();`
 * I’m afraid that I can’t try to replicate that outside of Bitnami as I haven’t
   set up a non Bitnami server. Do you think it’s linked to the environment? Bitnami
   is a very simple LAMP setup though. I find it surprising.
 * Thanks for the plugin, and the support!
 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-headers-information/#post-9616989)
 * Yes, I think it’s linked to the environment, either Bitnami specifically or some
   other aspect of your configuration. Let me know if you track down specific reproduction
   steps.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cannot modify headers information’ is closed to new replies.

 * ![](https://ps.w.org/wp-native-php-sessions/assets/icon-256x256.png?rev=3411177)
 * [Native PHP Sessions](https://wordpress.org/plugins/wp-native-php-sessions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-native-php-sessions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-native-php-sessions/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-native-php-sessions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-native-php-sessions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-native-php-sessions/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-headers-information/#post-9616989)
 * Status: resolved