php 文件错误。愚蠢的小问题
使用 xampp 在桌面上工作正常,但当我将其上传到我的网络主机时,却无法正常工作。文件 x.csv 位于同一目录中,
$csv_file = "x.csv";
$handle = fopen(($csv_file), "r");
我得到的错误是-
fopen(x.csv): failed to open stream: No such file or directory in /var/www/html/x/admin/import_one.php on line 12
我哪里出错了?
works fine on the desktop with xampp but when i upload it to my webhost it doesnt. The file x.csv is in the same dir
$csv_file = "x.csv";
$handle = fopen(($csv_file), "r");
the error i get is-
fopen(x.csv): failed to open stream: No such file or directory in /var/www/html/x/admin/import_one.php on line 12
Where am I going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查您是否具有 x.csv 的读取权限
也尝试一下
(maybe your cwd isn't in the same directory)
check that you have reading permissions for x.csv
also try
(maybe your cwd isn't in the same directory)
Linux 区分大小写,Windows 不区分大小写。
确保您的文件名为
x.csv
,而不是X.csv
或x.CSV
。Linux is case-sensitive, Windows isn't.
Make sure that your file is called
x.csv
and notX.csv
orx.CSV
.如有疑问,请使用绝对文件路径。
When in doubt use absolute file path.