Replace PHP's realpath()

前端 未结 6 1867
悲哀的现实
悲哀的现实 2020-12-05 01:21

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

6条回答
  •  攒了一身酷
    2020-12-05 01:55

    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.

提交回复
热议问题