WP-Codebox fix so that it doesn’t prevent posts export
May 15, 2010 — Florent ClairambaultIf you have a PHP configured with some open_basedir restriction (which is recommended), the WP-Codebox plugin will prevent you from exporting the posts of your blog.
Go to your blog, go in the “wp-content/plugins/wp-codebox” dir and edit the “wp-codebox.php” file :
On line 27, you should have :
1 2 | include_once "../../../wp-config.php"; include_once "../../../wp-settings.php"; |
Well, it fails because the plugin doesn’t use the good practices, so it’s pretty easy to fix :
1 2 | require_once( ABSPATH.'/wp-config.php' ); require_once( ABSPATH.'/wp-settings.php' ); |
I’d like to thank the developer of this plugin for doing such a great job. It brings the power of geshi (not the latest version by the way) into wordpress.
GD Star Rating
loading...
loading...

February 8, 2011 at 7:09 am
Thanks for the post.
When I use the file option and click on download.txt, I get the following error.
I have my wp-config installed above my root directory … any thoughts?
Warning: include_once(../../../wp-config.php) [function.include-once]: failed to open stream: No such file or directory in /homepages/xx/xxxxxxxxxx/htdocs/xxxxxxxxxxxx/wp-content/plugins/wp-codebox/wp-codebox.php on line 27
Warning: include_once() [function.include]: Failed opening ‘../../../wp-config.php’ for inclusion (include_path=’.:/usr/lib/php5′) in /homepages/xx/xxxxxxxxxx/htdocs/xxxxxxxxxxxx/wp-content/plugins/wp-codebox/wp-codebox.php on line 27
Warning: require(ABSPATHwp-includes/load.php) [function.require]: failed to open stream: No such file or directory in /homepages/xx/xxxxxxxxxx/htdocs/xxxxxxxxxxxx/wp-settings.php on line 19
Fatal error: require() [function.require]: Failed opening required ‘ABSPATHwp-includes/load.php’ (include_path=’.:/usr/lib/php5′) in /homepages/xx/xxxxxxxxxx/htdocs/xxxxxxxxxxxx/wp-settings.php on line 19
loading...
March 18, 2011 at 3:50 am
[...] found a way to solve this on Florent Clairambault’s Blog as like [...]
March 18, 2011 at 3:52 am
thank you! it helps.
loading...