执行时,在我的laravel根目录中创建了文件test.csv
$file = fopen('test.csv');
本地。
但是,通过ftp访问Azure Web应用程序时找不到文件。
它将保存到哪里?
答案 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.6
,7.0
,7.1
和7.2
,如下所示。
我试图通过使用Kudu控制台上的每个PHP版本执行fopen('test.csv')
来获得相同的错误PHP Warning: fopen() expects at least 2 parameters, 1 given in Command line code on line 1
。
除了使用fopen('test.csv', 'w')
之外,它将在我当前的Kudu控制台目录中创建一个test.csv
文件。
所以我想您的laravel项目中的一些配置或代码掩盖了此错误。
同时,正如@Marzouk所说,为fopen
参数$filename
使用指定的绝对路径将有助于避免创建不确定的文件路径。