azure Web应用程序将fopen('test.csv')保存在哪里?

时间:2018-12-04 15:17:21

标签: php azure web-applications azure-web-sites fopen

执行时,在我的laravel根目录中创建了文件test.csv

$file = fopen('test.csv');

本地。

但是,通过ftp访问Azure Web应用程序时找不到文件。

它将保存到哪里?

2 个答案:

答案 0 :(得分:0)

您应该为此指定绝对路径。

import scipy.io as sio data = sio.loadmat(filepath, verify_compressed_data_integrity=False) 将在根目录中创建文件,该文件可能会根据Azure基础架构的内容而变化。

答案 1 :(得分:0)

您的php代码似乎不正确,该函数在函数fopen中缺少参数mode。 Azure门户上的WebApp支持四个PHP版本,包括5.67.07.17.2,如下所示。

enter image description here

我试图通过使用Kudu控制台上的每个PHP版本执行fopen('test.csv')来获得相同的错误PHP Warning: fopen() expects at least 2 parameters, 1 given in Command line code on line 1

enter image description here

除了使用fopen('test.csv', 'w')之外,它将在我当前的Kudu控制台目录中创建一个test.csv文件。

enter image description here

所以我想您的laravel项目中的一些配置或代码掩盖了此错误。

同时,正如@Marzouk所说,为fopen参数$filename使用指定的绝对路径将有助于避免创建不确定的文件路径。