问题描述
我在使用 PHP 7.4.6 的自定义项目中使用 Doctrine。当我尝试应用迁移时,出现此错误
[error] Migration app\migrations\Version20210113120851 Failed during Pre-Checks. Error: "Provided directory "C:\Users\836D~1\AppData\Local\Temp" does not exist"
In InvalidProxyDirectoryException.PHP line 18:
Provided directory "C:\Users\836D~1\AppData\Local\Temp" does not exist
解决方法
如果您使用的是 Windows,问题可能出在“vendor/friendsofphp/proxy-manager-lts/src/ProxyManager/FileLocator/FileLocator.php”中。要进行迁移,您只需在构造函数中注释 $absolutePath = realpath($proxiesDirectory);
行并明确指定您的临时目录路径。
例如:
//$absolutePath = realpath($proxiesDirectory);
$absolutePath = 'C:\Temp';