Skip to content

Instantly share code, notes, and snippets.

@seancojr
Created April 3, 2016 02:46
Show Gist options
  • Save seancojr/c049c2f345ae837f5e224f34143a85fa to your computer and use it in GitHub Desktop.
Save seancojr/c049c2f345ae837f5e224f34143a85fa to your computer and use it in GitHub Desktop.
If you see an error like "Fatal error: session_start(): Failed to initialize storage module: user (path: ) in .../code/wp-content/plugins/plugin-that-uses-sessions/example.php on line 2" you likely have a plugin in the mu-plugins directory that is instantiating a session prior to this plugin loading. To fix, you will need to deactivate this plug…
<?php
/*
Plugin Name: MU WP Native PHP Sessions
Plugin URI: https://wordpress.org/plugins/wp-native-php-sessions/
Description: Building on Pantheon's and WordPress's strengths, together.
Version: 0.1
Author: Pantheon
Author URI: http://getpantheon.com
*/
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) :
require_once( 'wp-native-php-sessions/pantheon-sessions.php' );
endif; # Ensuring that this is on Pantheon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment