【问题标题】:Why does the php script work on free hosting and on my vps it doesn't?为什么 php 脚本可以在免费托管上运行,而在我的 vps 上却不行?
【发布时间】:2016-02-24 23:38:55
【问题描述】:

为什么在一台服务器上会出现500错误?我没有任何想法!

脚本 php:

<?php
require('simple_html_dom.php');

$html = file_get_html("//strona.pl/".$_GET['url'];);
$wynik= $html->find("klasa",0) ->innertext;

print_r($wynik);
?>

(错误 500)这个脚本在我自己的 vps 上: skrypt.php

(work corectlly) 免费主机上的这个脚本: androidpolska.php

【问题讨论】:

  • 检查错误日志。
  • ^^ 或在您的 php 页面顶部添加:ini_set('display_errors', 'On'); ini_set('html_errors', 0); error_reporting(-1);

标签: php server vps


【解决方案1】:

老兄,可能 allow-url-fopen 配置被禁用了。

http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen

【讨论】:

  • 是的。这就对了。谢谢:)
猜你喜欢
  • 2021-01-23
  • 2010-11-21
  • 2017-03-28
  • 2021-10-06
  • 2019-05-25
  • 2020-03-05
  • 1970-01-01
  • 2014-09-15
  • 2021-10-06
相关资源
最近更新 更多