> However, I found a different solution: Rather than trying to initialize
> Midgard from within a .php file, I require() my .php file from an
ordinary
> Midgard page:
<quote_stephan_elsner>
I had this idea too.
But it's not only one page but a whole community system which calls it's
own subpages.
I solved the problem by accessing the midgard databases directly with mysql
commands from phpbb2.
</quote_stephan_elsner>
Stephan,
Because I was planning to use phpBB as well on a Midgard site, I gave it a
try when I read your post today and uploaded the last phpBB2 release to a
directory "phpBB" to my webspace on a hosted Midgard environment.
I did the following:
1a
Create an active page "phpBB" (or whatever) on your Midgard system:
with the content:
<?
require ($path."/phpBB/".$argv[0]);
?>
with $path according to your setup (has to be an abolute path on the server
in my experience)
By the way, if you want to catch requests for "/phpBB/" you might have to
test on $argc or $argv[0] and then redirect to "phpBB/index.php" or so, I
didn't experiment with this so far.
1b
Create an active subpage "admin" under "phpBB"
with the content
<?
require ($path."/phpBB/admin/".$argv[0]);
?>
1c
Create a static subpage "templates" under "phpBB" (so all images and css'es
are served nicely)
Unfortunately, this is not where it ends. I'm not sure whether the rest of
what I'll be writing applies to any Midgard setup, or just the one I'm using
in particular (I have an open_basedir restriction on the server, so I'm not
sure sometimes what the problem exactly is). The main issue is that the
server doesn't understand the relative paths in php require and include
statements, such as "./index.php" or "../../includes/lib.php". So do a
search and replace on your phpBB files and:
2
Change "$phpbb_root_path = './' " (or some other relative path) into
$phpbb_root_path = $root_dir."phpBB/" (whatever your $rootdir is - on my
setup, I have the experience it has to be an absolute path on the unix
server, such as:
$phpbb_root_path = '/var/www/html/phpBB/';
3
do the same in /phpBB/includes/functions_selects.php , line 27:
function language_select($default, $select_name = "language",
$dirname="/var/www/html/phpBB/language")
instead of just:
function language_select($default, $select_name = "language",
$dirname="language")
Specifically for the admin dir:
4
Change /phpBB/admin/index.php
line 28
require('./pagestart.' . $phpEx);
into
require($phpbb_root_path.'admin/pagestart.' . $phpEx);
in all files in the phpBB/admin directory
and analogously all other require and include statements:
include('./XXXXXXXXXXXX.'.$phpEx);
into
include($phpbb_root_path.'admin/XXXXXXXXXXXX.'.$phpEx);
5
Change admin/index.php, line 57 from
$dir = @opendir(".");
into
$dir = @opendir($root_dir."phpBB/admin/'); (whatever your rootdir is)
6
because the install script still did not work accurately, I had to create
the db scheme and start database manually in Mysql, and also upload my
config.php file with the generated database settings manually - but that may
be different in your situation again...
As far as I can see, everything (including administration) is working fine
right now.
Addendum:
I don't know why the phpBB people chose to repeat their $phpbb_root_path
initialisation, but still use relative paths for some includes or requires.
Choosing either one of the methods consistently would seam more logical to
me, but that's just a guess from what I know now.
An ideal solution for us would be to something like:
1
a path_init.php file where you define a constant PHPBB_ROOTPATH .
2
start every script with:
@require("relative_path_to_path_initialisation_file"."path_init.php"); //(if
this fails, it fails silently and the PHPBB_ROOTPATH is not set )
if (! defined ("PHPBB_ROOTPATH") define ("PHPBB_ROOTPATH",
"root_path_to_search_and_replace" ) ; //If the relative path doesn't work,
you'll have manually change the define statement in every single file.
...and then use absolute paths using PHPBB_ROOTPATH for every require and
include... Using Midgard, we could nicely define the constant in the
Midgard page, before the require statement in the content field of the
"phpBB" and "phpBB/admin" Midgardpages. I won't dive further into phpBB for
the moment, but if anyone is motivated to take it up with the phpBB people
:-) ?
pascal
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]