开发者

Realpath not working with ../files?

开发者 https://www.devze.com 2022-12-25 06:20 出处:网络
I am developing under wamp. echo realpath(APPPATH); C:\\wamp\\www\\salsaritmo\\system\\application echo realpath(APPPATH . \'..\');

I am developing under wamp.

echo realpath(APPPATH);

C:\wamp\www\salsaritmo\system\application

echo realpath(APPPATH . '..');

C:\wamp\www开发者_运维技巧\salsaritmo\system

echo realpath(APPPATH . '../files');  //(which is the one i want)

returns nothing


realpath() returns FALSE on failure, e.g. if the file does not exist.


Your APPPATH doesn't end with a directory separator, so you're ending up trying to realpath('C:\wamp\www\salsaritmo\system../files'), which obviously isn't valid. Try:

   echo realpath(APPPATH . '/../files');
0

精彩评论

暂无评论...
验证码 换一张
取 消