我写了script,广泛使用file_get_contents
。但它停止在一个地方工作,这是有问题的片段:
private function patch_codeigniter_file($file_location)
{
$this->backup_file($file_location);
$tmp = explode(DIRECTORY_SEPARATOR, $file_location);
$file_name = end($tmp);
$file = file_get_contents($file_location);
// ...
}
file_get_contents
返回一个空字符串。以下是关于背景的几个事实:
$file_location
是本地文件的绝对路径。$file_location
指向的文件(是的,这是事实)file_get_contents
不会返回任何错误。error_reporting
设置为-1
有人知道问题可能是什么吗?就在今天早上file_get_contents
工作正常,我尝试使用Windows 7虚拟机,它运行正常。