Jump to content

Need help with detecting path on server


krembo99

Recommended Posts

Hello all..

 

I have a problem with grabbing a path to document with a php wordpress plugin.

This is the function that requires it:

 

require_once(getenv("DOCUMENT_ROOT").PLUGINPATH.'defaults.php');

 

And this is the warning :

 

Warning: getadminoptions(/web/htdocs/www.mydomainName.com/home//wp-content/plugins/somepluginname/defaults.php) [function.getadminoptions]: failed to open stream: No such file or directory in /web/htdocs/www.krembo99.com/home/m33/wp-content/plugins/somepluginname/somepluginname.php on line 78

Fatal error: getadminoptions() [function.require]: Failed opening required '/web/htdocs/www.mydomainName.com/home//wp-content/plugins/somepluginname/defaults.php' (include_path='.:/php/lib/php/') in /web/htdocs/www.mydomainName.com/home/m33/wp-content/plugins/somepluginname/somepluginname.php on line 78

 

note the DOUBLE slashes after "..mydomainName.com/home//wp-content/.." , but the real path is the one indicated below , EG : "..mydomainName.com/home/m33/wp-content/.."

So I guess the environmental VAR used [getenv("DOCUMENT_ROOT")] is wrong (because it is not installed at the root but under "m33" but since I am far from being a PHP guru, I do not know which VAR I can use, or HOW to fix this problem.

 

anyone ?

 

Link to comment
Share on other sites

Ok, I have temporarly solved the problem by changing the :

define("PLUGINPATH", "/wp-content/plugins/autoblogged/");

to

define("PLUGINPATH", "[color=red]m33[/color]/wp-content/plugins/autoblogged/");

 

but still, how can I change it to something that will AUTODETECT the path ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.