|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-10-18 18:04 UTC] federeghe at hotmail dot it
Description:
------------
View code. On 4? line, apache crashes...
Reproduce code:
---------------
$this->stream = fopen('./html/page.phtml', 'r');
$this->page = fread($this->stream,filesize('./html/page.phtml'));
fclose($this->stream);
$this->stream=NULL; //Crash apache (???)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
This is complete script <?php if(!defined("IN_RESCHOOL")) exit; //If not defined "go costant" exit error_reporting("E_ALL"); $file = new file; $page = new page; function inc($file,$once=0) { if($once==0) { include($file); } if($once==1) { include_once($file); } } class file { var $stream; function read($filename) { $this->stream = fopen('./'.$filename, 'r'); $return = fread($this->stream,filesize($filename)); fclose($this->stream); $this->stream=NULL; //Crash apache (???) return($return); } } class page { var $content; var $head; var $title; function add($text) { $this->content.=$text; } function head($text) { $this->head=$text; } function title($title) { $this->title=$title; } function go() { global $file; $html = $file->read('html/standard.phtml'); $html = replace($html); echo $html; } function replace($text) { $text = str_replace("{CONTENT}",$this->content,$text); $text = str_replace("{TITLE}",$this->title,$text); $text = str_replace("{HEAD}",$this->head,$text); $text = str_replace("{MENU}",$this->menu(),$text); $text = str_replace("{NAME}",$config->name_school,$text); return($text); } function specialpage($page) { global $file; switch($page) { case('login-student'): $this->title = 'Login'; $this->head($file->read('html/login-student-head.phtml')); $this->add($file->read('html/login-student.phtml')); break; case('login-prof'): $this->title = 'Login Prof'; $this->head($file->read('html/login-prof-head.phtml')); $this->add($file->read('html/login-prof.phtml')); break; } } } ?> In windows the crash is: "Si ? verificato un errore in Apache.exe. L'applicazione verr? chiusa." equal to "An error occurred in Apache.exe. The application will be closed." on linux I don't know the crash but "The page cannot be displayed" to all other pages.