Apparently, realpath
is very buggy. In PHP 5.3.1, it causes random crashes.
In 5.3.0 and less, realpath
randomly fails and returns false (for the s
On Windows 7, the code works fine. On Linux, there is a problem in that the path generated starts with (in my case) home/xxx when it should start with /home/xxx ... ie the initial /, indicating the root folder, is missing. The problem is not so much with this function, but with what getcwd returns in Linux.