我需要帮助解决这个错误:Laravel地方:FOPEN权限被拒绝
fopen(/Subckt.txt): failed to open stream: Permission denied
- 我使用Laravel
- 我工作的网站在本地使用CMD与PHP 工匠服务命令
- 我发现了一些与chmod的潜在解决方案,但由于我使用本地主机,我不认为它的工作
- 该网站正在运行一个PHP代码来修改一个txt文件。然后我将它保存到另一个文件。在根文件夹中。
- 整个网站文件夹被声明为只读,我无法修改该文件夹。 (我使用Windows 7,当我取消选中它总是重新检查框,但我设法删除只读文本文件(Subckt.txt和\ npn.lib)
- 我试着我的代码没有laravel在。PHP和HTML文件,它的工作原理
这里是我的部分代码:。
// Load the output file
$outputFile = fopen("\Subckt.txt", "w") or die("Unable to open file!");
// Load the input file into string
$inputFile = "\npn.lib";
// Put the input file in a string variable
$inputFileContent = file_get_contents($inputFile);
检查你的'基路径'。 'fopen'函数似乎试图从文件系统的根目录加载文件,这肯定会产生权限冲突。 – Ohgodwhy
In:$ inputFile =“\ npn.lib”; \ n被认为是新行... – Mark
$ inputFileContent = file_get_contents(“C:\ Users \ username \ Desktop \ model \\ testnpn.lib”);而不是2行 – Mark