Originally Posted by
raycruzer
I must correct myself for making my assumption about __DIR__. I did the echo __DIR__ as you suggested and got this:
C:\HostingSpaces\ergonicauser1\ergonica.com\newroot\zc_install . Then I echoed __FILE__ and saw this: C:\HostingSpaces\ergonicauser1\ergonica.com\newroot\zc_install\test.php . As you know, the statement above is
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__)); So it's looking for dirname() which includes the entire hierarchy, as you say, but that includes levels where we have no permissions and includes directories above and beyond my hosting space. How can we fix that?
Fix what? DIR_FS_ROOT is to be the full path from the base of the server to the location of question. It is not a "relative" link from the webspace.
To continue on with the test. Now that echo __DIR__ has provided a reasonable result, would suggest echoing the next parts:
Code:
echo __DIR__ . '/../';
echo "\n";
echo realpath(__DIR__ . '/../');
I'm not seeing how the if not defined __DIR__, then define __DIR__ has anything to do with this issue.
If the teeny test.php file were generated as requested to have just 2 lines in it and you achieved the posted result of having a value for __DIR__, then the discussed line in the previous post about defining __DIR__ isn't even executed nor relevant.
Bookmarks