나는 우분투 11.10에 있습니다. echo phpinfo();
과 같은 간단한 스크립트를 작성하면 오류가 표시됩니다. 하지만 일부 추가 PHP 코드를 작성하려고하면 브라우저 서버 오류 페이지가 표시됩니다. 내가 이해하지 못하는 문제는 무엇인가? ??우분투에서 PHP 서버 오류 11.10
코드를 다음과 같이 변경하면 서버 오류가 발생합니다.
<?php
class MyClass{
private $prop;
public function __construct(){
echo "The class \"".__CLASS__."\"was created";
}
public function __destruct(){
echo "The class \"".__CLASS__."\" was destroyed";
}
protected function getProperty(){
return $prop;
}
public function __toString(){
echo "__toString() method called.<br />";
return $this->getProperty().'<br />';
}
public function setProperty($prop){
$this->prop = $prop;
}
}
class MyOtherClass extends MyClass{
public function __construct(){
parent::__contruct();
echo "A new constructor in class \"".__CLASS__"\"";
}
public function newMethod(){
echo 'From a new method in class '.__CLASS__.'<br />';
}
}
$newClass = new MyOtherClass();
echo $newClass->getProperty();
?>
코드 샘플을 제공해 주시겠습니까? – Mike
질문을 수정했습니다 ... – Sandeep
Sever Error 란 무엇입니까? – Shad