【问题标题】:PHP file opening errorPHP文件打开错误
【发布时间】:2015-05-02 01:06:57
【问题描述】:

好的,所以我到处寻找这个问题的答案,但找不到。所以我的godaddy网站上有一个php文件。第二次我添加了这行代码:

$myfile = fopen("fileName.txt", "r") or die("Unable to open file!");

它打印出这个错误。

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

我查看了服务器错误日志,但一无所获。我已将错误设置更改为 E_ALL 并再次查看日志,但一无所获。我在 godaddy 上使用 Windows plesk 托管,并且我已经更改了用于写入/读取/和修改的文件权限的复选框。似乎没有任何效果。 非常感谢您的宝贵时间,请帮忙!

【问题讨论】:

  • 您确定您所做的唯一更改吗?注释掉该行会发生什么?
  • 如果我注释掉该行页面加载正常。这是我唯一遗憾地做出的改变
  • 我非常怀疑您的 PHP 错误日志中没有放入任何内容。您可能正在查看错误的文件。
  • 看看@web服务器错误日志

标签: php file fopen


【解决方案1】:

问题不在于服务器配置。 您必须更改 php.ini 文件的配置。查看 allow_url_fopen 设置。

【讨论】:

  • 我在 godaddys 控制面板中激活了它。我必须单独制作一个 php.ini 文件吗?谢谢!
  • fileName.txt 是网址吗?
  • fileName.txt 只是服务器上的一个文本文档
  • 如果您对php配置进行了更改,您还需要重新启动服务器。
  • 感谢您的帮助,我现在试试
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-22
  • 1970-01-01
  • 2015-08-22
  • 2011-10-19
  • 2011-07-18
  • 2014-02-11
相关资源
最近更新 更多