更新时间:2023-02-22 22:12:15
如果我没看错你的问题,我想我在访问 XAMPP 中的 php 文件时遇到了同样的问题.我已经在网上搜索了几个小时,在论坛和谷歌上寻找答案,直到我找到了简单的解决方案.
If I got your question correctly, I think I had the same problem accessing a php file in XAMPP. I have been online for several hours searching forums and Google for the answer, not until I found the simple solution.
我将 PHP 文件作为 c 盘上的文件访问(例如 C:xamphtdocsdata.php
或 file:///c:/xamp/htdocs/data.php
)而不是作为网页(即//localhost/data.php
).
I was accessing the PHP file as a file on c drive (eg. C:xamphtdocsdata.php
or file:///c:/xamp/htdocs/data.php
) instead of as a webpage (ie //localhost/data.php
).
我希望这对你也有帮助.
I hope this will be helpful to you as well.