简体   繁体   中英

Clear cache before and after CHMOD

It seems like PHP keep chmod info in cache. It still the same after an update (which succeed, as I see it in my FTP)

CHMOD before execute : 0505

chmod($file, 0705);
echo "1 :".substr(sprintf('%o', fileperms($file)), -4)."<br>"; //print "0505"
echo "2 :".intval(substr(sprintf('%o', fileperms($file)), -4))."<br>"; // Another test, doesn't work : print "505"

What should I do to get the real current chmod ? Is it possible ?

Thx !

From PHP fileperms manual:

Note: The results of this function are cached. See clearstatcache() for more details.

See http://php.net/manual/en/function.clearstatcache.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM