fuel/core — Issue #597: Realpath doesn't resolve symlinks properly
Author: JesseObrien
Created: 2011-10-21 22:52:01+00:00
State: open

This is in regards to https://github.com/fuel/fuel/blob/1.1/develop/public/index.php
```php
define('APPPATH', realpath(__DIR__.'/../fuel/app/').DIRECTORY_SEPARATOR);
define('PKGPATH', realpath(__DIR__.'/../fuel/packages/').DIRECTORY_SEPARATOR);
define('COREPATH', realpath(__DIR__.'/../fuel/core/').DIRECTORY_SEPARATOR);
```

I'm not sure if it's related to [this](https://bugs.php.net/bug.php?id=50366) bug in PHP or not. [This](http://sixohthree.com/1517/php-and-the-realpath-cache) post and [this](http://www.utoxin.name/2011/06/cakephp-symlinks-pain/) post lead me to believe it's not that bug, it's the issues with caching. The issue seems to be stemming from realpath() and it's caching of paths, which might actually change if symlinks are moved or folder structures are modified. This caching happens *per thread*. I'm not sure if there's a better solution than realpath here or not though. The recommended solution is to restart apache in between upgrades to fully clear the cache.