Looktrne Posted January 30, 2008 Share Posted January 30, 2008 I am trying to find out inside what file a certain function happens.... is there a way to track what php is doing as far as what file is being opened when? like if I run index.php and it requires "file1.php" is there a way of knowing that it opened file1.php?? thanks for any help Quote Link to comment https://forums.phpfreaks.com/topic/88629-trying-to-debug-some-code/ Share on other sites More sharing options...
kts Posted January 30, 2008 Share Posted January 30, 2008 put an echo inside the included file to see if its coming through Quote Link to comment https://forums.phpfreaks.com/topic/88629-trying-to-debug-some-code/#findComment-453849 Share on other sites More sharing options...
Looktrne Posted February 1, 2008 Author Share Posted February 1, 2008 this script is including 10-20 files no otherway to get like a live log? Paul Quote Link to comment https://forums.phpfreaks.com/topic/88629-trying-to-debug-some-code/#findComment-454968 Share on other sites More sharing options...
revraz Posted February 1, 2008 Share Posted February 1, 2008 You would get an error if it doesn't find the file you are including. Quote Link to comment https://forums.phpfreaks.com/topic/88629-trying-to-debug-some-code/#findComment-454984 Share on other sites More sharing options...
laffin Posted February 1, 2008 Share Posted February 1, 2008 if ya are including it from a variable than easier to attch an echo or add to log file right after the include include($inc="$page.php"); mylog("include($inc)"); function mylog($msg) { if ($fp = @fopen("my.log", "a")) { $msg="$msg\n"; fwrite($fp, $msg, strlen($msg)); fclose($fp); } } might be a bit ugly but works Quote Link to comment https://forums.phpfreaks.com/topic/88629-trying-to-debug-some-code/#findComment-455040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.