| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2012-05-08 18:31 UTC] rasmus@php.net
  [2012-05-08 18:31 UTC] rasmus@php.net
 
-Status: Open
+Status: Not a bug
  [2013-09-22 09:56 UTC] isidoros dot anthemios at gmail dot com
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 11:00:01 2025 UTC | 
Description: ------------ When running APC, if a script uses the __FILE__ magic constant to determine the full directory name of where the script is running from, it will continue to get the same directory, even if the directory of the script is renamed. Example: Place the test script in a directory named "mydir1" and access the script with a browser. Then, in the directory above mydir1, type "mv mydir1 mydir2" to rename the directory. If you access the script now, it will not be found. If you then change the url to reference the script in the proper directory of mydir2, it will be found, however, it will report the __FILE__ magic constant to be mydir1. This can cause issues if one uses __FILE__ when including other scripts, as they won't be found after the directory is renamed, until the APC cache is cleared or the script's timestamp is modified. I tried running this on a server without APC and it behaved as expected. Test script: --------------- <?php echo ' hello '.date('r').'<br/>'; echo ' magic constant __FILE__ '.__FILE__."<br/>"; ?> Expected result: ---------------- I expect it to output the correct full path to the script Actual result: -------------- It outputs the path of the script as it was before renaming the directory.