ID: 43023 Updated by: [EMAIL PROTECTED] Reported By: federeghe at hotmail dot it -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: All PHP Version: 5.3CVS-2007-10-18 (CVS) New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-10-19 12:52:55] federeghe at hotmail dot it on 3° line there isn't "exit"... Error on copy-past ------------------------------------------------------------------------ [2007-10-19 12:50:16] federeghe at hotmail dot it 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. ------------------------------------------------------------------------ [2007-10-19 08:32:18] [EMAIL PROTECTED] And please explain what "crash" means in this context. A segfault? Then please also provide a backtrace. ------------------------------------------------------------------------ [2007-10-19 08:31:25] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2007-10-18 18:04:42] 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 (???) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43023&edit=1