NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Failed to map remote file error


Joined: 09 Oct 2003
Posts: 60
Location: Bristol, England
Reply with quote
Hi,

I'm having a problem when I try to debug my pages in the debugger. I am using my external Apache/PHP/MySql setup (all the latest versions).

The error I'm having is:

"Failed to map remote file "(path to file)\config_vars.inc.php(25) : eval()'d code" to any local file. Check mapping settings for the project"

It appears in a dialog box at the end of the debugging of the page. I've checked the mapping settings and they seem OK (the rest of the page works and is rendered perfectly in the output tab). I'm assuming the (25) after the file name refers to the line number of that file, which is:

$strEval = eval("\$strCfgValue = ".$strLQuote.$strCfgValue.$strRQuote.";");

The purpose of the include is to read some config variables from the database and convert them into constants using the DEFINE command. This is done right at the top of the page before any other code is executed. Coincidentally, the dialog box appears exactly the same amount of times as there are config variables to define, but as I said, it only appears after all the debugging has finished.

It works perfectly when I run the pages in the browser, but it seems the debugger doesn't understand the eval command as the debugger shows $strEval as NULL everytime it executes the command.

I think that's everything. Can anyone suggest what could be wrong and possible solutions, please?

Thanks.

Debbie-Leigh
View user's profileFind all posts by Debbie-LeighSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
seems you run phped build 3220 or an earlier one.
I'd recommend you upgrade to phped 3.2 update pack #1.

Regarding evaluated data result, it depends on what code you passed to eval function. I think, debugger showed you the value that was actually returned by eval() function. Debugger just can't obsfucate this way:).
Regarding "unmapped..." error message, whenever you step the eval() function call you'd do Step Over, not Step In, anyway in the build 3239 this warning window is not shown when stepped through code is in eval() function.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Failed to map remote file error


Joined: 09 Oct 2003
Posts: 60
Location: Bristol, England
Reply with quote
Hi ddmitrie,

I have just downloaded phped (trial version), which why I have been testing it out with my development site. So I do have the 3239 version and have been using the step over action on the eval statement.

Also, the dialog box doesn't appear when I'm doing the eval, only when the whole page has been debugged and hence long after the eval has finished, which is one thing that has me confused (i.e. why doesn't it appear at the time the statement it's complaining about gets executed, if the two are linked?).

The other thing is why is it trying to map anything at all? I mean, all the eval returns is a value to be assigned to a constant, not a file name or anything. So what's causing it to try to map the output to something?

To answer your question about what was passed to the eval:

$strCfgValue contains a string which is assigned to the name of the constant in the define statement:

define($rsConfig['cfgKey'], $strCfgValue);

$strLQuote and $strRQuote may contain either " or nothing, depending on whether the value needs to be surrounded with quotes before being assigned to the constant.

Oh, and am I right in thinking that the (25) after the path name refers to the line number of the offending statement (just in case I'm concentrating on the wrong place).

Debbie-Leigh
View user's profileFind all posts by Debbie-LeighSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Quote:
Also, the dialog box doesn't appear when I'm doing the eval, only when the whole page has been debugged and hence long after the eval has finished, which is one thing that has me confused (i.e. why doesn't it appear at the time the statement it's complaining about gets executed, if the two are linked?).

What does appear after long time ? If you get anything wrong with 3239 please compose a test case and send me.
Quote:
The other thing is why is it trying to map anything at all? I mean, all the eval returns is a value to be assigned to a constant, not a file name or anything. So what's causing it to try to map the output to something?

Eval() function executes passed string as a file and regiters it internally under "eval'd..." file name. PhpED is not involved, it just tries to recognize from where to take local sources for that file. In PhpED's world it is called "mapping".
Quote:
$strCfgValue contains a string which is assigned to the name of the constant in the define statement:

define($rsConfig['cfgKey'], $strCfgValue);

It confuses a bit. You statement is just assignment of $strCfgValue value to the array element, technically it's similar to:
Code:
$rsConfig['cfgKey'] = $strCfgValue;
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Failed to map remote file error


Joined: 09 Oct 2003
Posts: 60
Location: Bristol, England
Reply with quote
To answer your points in order:

1. As I said, it's the dialog boxes that I was referring to, that appear at the end of the script with the message:

"Failed to map remote file "(path to file)\config_vars.inc.php(25) : eval()'d code" to any local file. Check mapping settings for the project"

They also seem to cause the debugging session to stop, so I can't seem to click something on the output page and continue debugging the page, which is what the documentation seems to say you can do (and what I was really looking for in a debugger).

2. Hmmm, that's something about eval I wasn't aware of. Is there any way to get phped to ignore the eval then, as there really isn't any point in it looking for the eval()'d file as a real file, as it doesn't really exist does it? Or is there a way to set up a dummy mapping for phped to find?

3. I need to use the eval as some of the values on the database contain names of other constants that need to be substituted for their actual values before the resulting value is assigned to the current constant. I hope that made sense. Smile

So, as far as I can see, what I need to do now is somehow get phped to ignore the eval or set up a dummy mapping, which will hopefully stop the resulting dialog boxes from appearing too.

Hope you can help.

Debbie-Leigh
View user's profileFind all posts by Debbie-LeighSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Yep it's how phped 3.2 behaves if you have a problem/syntax error in the code being evaluated using eval() function all.

It's been fixed in phped 3.3.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Failed to map remote file error
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
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic