 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
RedCorvette
Joined: 11 Jun 2003 Posts: 8
|
Posted: Thu Jun 12, 2003 1:48 pm Post subject: FIX Fatal error: Failed opening required '//b2config.php' |
|
|
My original error after installing b2 version 0.6.2 when trying to access index.php.
" Fatal error: Failed opening required '//b2config.php' (include_path='') in /blog.header.php on line 9 "
I'm writing this after 3 days of almost going insane in getting b2 to run on my site without errors. I am hoping that if anyone gets this error they will hopefully be saved from the headache and frustration that I went through. Hopefully this will also help Michel improve the installation of future b2 versions.
Stats on the server my site resides on.
PHP 4.0.6
MySQL 3.23.32
b2 is installed in a subdirectory called b2. For example,
/home/www/user = default web files
/home/www/user/b2 = where my b2 files are kept including index.php
The error above is the first error I received after I installing b2.
To fix this error, you will need to edit the following files.
In b2config.php, replace the line
Code: | $b2inc = './b2-include'; |
to the actual path of the b2-include directory. For example, following our scenario, it would be changed to
Code: | $b2inc = '/home/www/user/b2/b2-include'; |
In blog.header.php, replace the lines
Code: |
require_once (dirname(__FILE__).'/b2config.php');
$b2blah = dirname(__FILE__).'/';
|
with (Thanks to macshack for the following code. )
Code: |
$b2blah = '/home/www/user/b2/'; // <<<< with trailing '/'
require_once ($b2blah.'b2config.php');
|
In the same file, replace the lines
Code: |
require_once ($b2blah.$b2inc.'/b2template.functions.php');
require_once ($b2blah.$b2inc.'/b2vars.php');
require_once ($b2blah.$b2inc.'/b2functions.php');
require_once ($b2blah.$b2inc.'/xmlrpc.inc');
require_once ($b2blah.$b2inc.'/xmlrpcs.inc');
|
with
Code: |
require_once ($b2inc.'/b2template.functions.php');
require_once ($b2inc.'/b2vars.php');
require_once ($b2inc.'/b2functions.php');
require_once ($b2inc.'/xmlrpc.inc');
require_once ($b2inc.'/xmlrpcs.inc');
|
With these changes, your b2 should now work without any errors.
But the Login screen, Post/Edit area and Registration screen won't be formatted correctly because it can't find the CSS page (b2-include/b2.css) it needs to load.
To fix this you need to edit a few more files. We're almost there.
In the following files,
b2header.php, b2login.php, b2register.php
replace ALL the lines (sometimes there's more than 1) in each file
Code: |
<link rel="stylesheet" href="<?php echo $b2inc; ?>/b2.css" type="text/css">
|
with
Code: |
<link rel="stylesheet" href="b2-include/b2.css" type="text/css">
|
In b2-include/b2quicktags.php,
replace the line
Code: | <script src="<?php echo $b2inc ?>/b2quicktags.js" language="JavaScript" type="text/javascript"> |
with
Code: | <script src="b2-include/b2quicktags.js" language="JavaScript" type="text/javascript"> |
That should do it. You should be able to see the correct formatting for the Login and Register screens and the Post/Edit page. The quicktags, if you have it enabled, should also work.
Thanks to macshack for helping me solve this problem. 
Last edited by RedCorvette on Sun Jul 06, 2003 9:35 am; edited 1 time in total |
|
Back to top |
|
 |
macshack
Joined: 17 Jul 2002 Posts: 1204 Location: Phoenix, Az
|
Posted: Thu Jun 12, 2003 3:14 pm Post subject: |
|
|
RedCorvette,
You welcome and glad to be of some help. But let's be clear. The steps you had to go through are not normal. B2 should run correctly without having to "hard code" the path to the b2 directory.
Now having said that, there is something very strange going on with your hosts configuration and software version which I never isolated completely. Things acted like include files were being or attempting to be, included twice and thus we get the re-declare error. In both your cases, index.php with archives.php, and b2edit.php, the error was on the first function of the first included file. Again, it look like the included files were attempted to be loaded twice.
I think the bottom line here is PHP v 4.0.6 is very old. We have tried to not do anything in the code that would move the "minimum release required" to a higher release. But over the course of time, changes have been made to and in the area of how the "includes" are done. Things like changing "include" to "require" or "require_once" in various places and the way that the path is discovered.
The various releases of b2 have been tested on a variety of PHP versions, but I admit, I did not test 0.6.2 on php 4.0.6.
I am glad you got things working on your host with php 4.0.6. Let us know if you discover any other "strange" abnormalities. _________________ Kind Regards,
Michael e |
|
Back to top |
|
 |
RedCorvette
Joined: 11 Jun 2003 Posts: 8
|
Posted: Thu Jun 12, 2003 10:15 pm Post subject: |
|
|
Hi macshack,
I'm not sure if this has to do with anything but does the php.ini file have to have some special settings. Well the php.ini file for my host resides in the /etc directory and root owns it so I can't really make any changes to it.
I tried copying that file to my default web directory but PHP still reads it from the /etc directory as reported by phpinfo.php.
If you want to know some settings in php.ini, let me know and I'll post. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|