【发布时间】:2014-12-31 23:23:53
【问题描述】:
我在同一个目录下有这两个php文件:
index.php
<?php
echo "before";
require('Parser.php');
echo "after";
?>
Parser.php
<?php
/**
* Class Parser
*/
class Parser
{
private $url;
function __construct($url)
{
$this->url = $url;
}
public function getUrl(){
return $this->url;
}
public functionsetUrl($url){
$this->url = $url;
}
}
?>
我需要导入 Parser 文件,因为我必须在我的索引文件中使用这个类,但我不能。
导入此类时出现问题,因为如果我尝试访问 index.php,我只能看到第一个打印:before。
我不知道问题出在哪里但是很奇怪,我的文件很简单。
我的 php 版本是 5.6,我使用 MAMP 作为 Web 服务器。
有人可以帮助我吗? 谢谢
【问题讨论】:
-
开启错误。你可能有一个
Fatal Error