DISCLAIMER

THIS IS A HACK TO SOLVE A WORDPRESS ERROR. I AM IN NO WAY RECOMMENDING THAT THIS TUTORIAL SHOULD BE USED FOR MALICIOUS AND/OR ILLEGAL PURPOSES.


Okay so I haven’t been back to this blog in ages, but I ran into something that I just really had to write about. See, I am working on this WordPress 3.6 website (running on WordPress.org) and experienced the following error:

Fatal error: session_start() [<a href=’function.session-start’>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home2/xxx/public_html/yyy/wp-includes/plugin.php on line 406

This error prevented me from accessing the website’s Dashboard. I would arrive at the log-in page (/wp-admin), enter my credentials then be presented with the error message when I tried to log in. (Note that xxx and yyy have been used as substitutions for the actual user account and website folder, respectively.)

I Googled until my brain hurt, then I stumbled across a solution that helped me to figure out my particular work around. The solution that is listed here, was in relation to a completely different problem and involved a line in the media.php file.

Anyhow, it pointed me in the right direction – which was to disable some code in plugin.php. (See error message above).

Now before I get into explaining the steps I followed, I’d like to tell you how/why I got the error. This error was generated by a plugin that I had just installed. It is called the WordPress Pageflip Gallery plugin. I suspect that this happened because the plugin is probably not yet fully compatible with WordPress 3.6 – at time of writing.

I should add here that I was fortunate enough to be aware of what caused the problem so it was easy for me to figure out a way to solve it. So I should add at this stage that you should always be aware of what you are doing – and document your processes as much as possible.

So, back to the solution. Here are the steps I followed:

  1. After encountering the error message, I figured that the error was being caused by some code in yyy/wp-includes/plugin.php – as stated by the error message.
  2. I backed up that particular plugin.php file and downloaded the live one.
  3. I opened in up in my PHP editor and scrolled down to line 406.
  4. Line 406 is in the middle of a do…while loop, so I figured I would comment out the whole function in which line 406 was in. This function runs from line 360 to 412, so I commented out all the code in and between those lines (following the example in this solution).
  5. I saved and re-uploaded the file and refreshed the page, but was presented with two additional errors. (I won’t go into those two errors).
  6. Back to the editor and removed the comments then commented out only lines 403 to 410. These are the lines that have the do…while statement.
  7. Re-uploaded the file and refreshed the page. This time I got access into the Dashboard. It was not the formatted Dashboard that I would have hoped to see, but nevertheless, I was in – a good sign.
  8. Using this stripped down version of the Dashboard, I headed over to the Plugins area, deactivated the Pageflip Gallery plugin, and deleted it.
  9. Back to the Editor and un-commented the do…while loop (ie lines 403 to 410), saved and re-uploaded the file.
  10. Another page refresh et voila! I had my Dashboard back!
  11. I learned my lesson to always check the compatibility of a plugin before installing it.

This was an exercise in regaining access to my Dashboard. I was not trying to fix the plugin. That is not my problem and the developers of the plugin should probably look into fixing it.

I hope this will be able to help someone with a similar problem.