Page 1 of 1

Absolute full path how to reminder

Posted: Wed Apr 13, 2016 11:18 am
by axew3
Absolute full path how to reminder.
Best way if you're not skilled enough or you're not sure, is to ask to your Provider or look into your Server Provider FAQ.

If you can't get out what's your Server full absolute path, follow this steps:

Create on a text editor a new blank file, just paste into it this php code:

Code: Select all

<?php phpinfo(); ?>
save the file as phpinfo.php or whatever-you-like.php and upload the file into your server root or another folder, maybe the phpBB root (not in WP root!). Call it by browser:

example: http://your-nice-site.com/phpinfo.php


The page will display several server's info. To get your absolute full path, search for the value assigned to:

_SERVER["DOCUMENT_ROOT"]
or
DOCUMENT_ROOT

This is your server absolute full path.

Example setting phpBB absolute path for wp_w3all phpBB WordPress integration plugin:

if DOCUMENT_ROOT return as value something like (assuming you've put it on your server root folder):
www/HTDOCS/web
assuming that your phpBB install reside inside the folder /forum into your web space, then your absolute full path to the forum folder will be this:
www/HTDOCS/web/forum


If you have choose to include the custom phpBB config.php, so you need to include the custom config.php file that you've copy/paste inside the folder /wp-w3all-config (that you have to create), so you'll have:
wp-content/plugins/wp-w3all-config/config.php, then the absolute path example in this case will look something like this:
www/htdocs/web/wp-content/plugins/wp-w3all-config


Do not put the phpinfo.php file (or whatever you name it) inside the WordPress root, because when you'll call it by browser WP will return page not found. Put the file OUTSIDE WordPress root directory.

HELP HINT:
Consider that the path value will return the absolute path plus any subfolder from where this file is executed, and which value can be for example:
www/HTDOCS/web/forum/myfolder
if you have put the phpinfo.php file into /myfolder folder, then you call it by browser in this way:

Code: Select all

http://mysite/forum/myfolder/phpinfo.php
SO the correct path that point to the correct folder (phpBB root folder or custom wp-w3all-config folder or whatever you like) which contain the phpbb config.php you want to use, will be like this, assuming for example that the phpBB config.php we want use in this case, reside on /forum folder:
www/HTDOCS/web/forum

Re: Absolute full path how to reminder

Posted: Sat Aug 27, 2016 10:41 pm
by axew3
By Karma 007 - since the phpinfo() do not show on my server the absolute path, i created a file path.php with this code inside:

Code: Select all

<?php
echo realpath("path.php");
?>
and calling it by browser, this give the good path (it was incorrect): no more error message.