copy 可以执行,rename 就报拒绝访问
public function replace($path, $content)
{
// If the path already exists and is a symlink, get the real path...
clearstatcache(true, $path);
$path = realpath($path) ?: $path;
$tempPath = tempnam(dirname($path), basename($path));
// Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600...
chmod($tempPath, 0777 - umask());
file_put_contents($tempPath, $content);
rename($tempPath, $path);
}
这段代码位于vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php
第132行,执行php artisan package:discover
后,rename会报拒绝访问的错误,但是改成copy就不会报错。
- 系统环境:windows10 64位
- php版本:7.3
- web服务器:apache
:+1: