File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / sapi / cli / tests / php_cli_server_015.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:35 2012 UTC (12 years, 2 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

    1: --TEST--
    2: Bug #60523 (PHP Errors are not reported in browsers using built-in SAPI)
    3: --SKIPIF--
    4: <?php
    5: include "skipif.inc"; 
    6: ?>
    7: --INI--
    8: display_errors=1
    9: --FILE--
   10: <?php
   11: include "php_cli_server.inc";
   12: php_cli_server_start('require("syntax_error.php");');
   13: $dir = realpath(dirname(__FILE__));
   14: 
   15: file_put_contents($dir . "/syntax_error.php", "<?php non_exists_function(); ?>");
   16: 
   17: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
   18: $port = intval($port)?:80;
   19: $output = '';
   20: 
   21: $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
   22: if (!$fp) {
   23:   die("connect failed");
   24: }
   25: 
   26: if(fwrite($fp, <<<HEADER
   27: GET /index.php HTTP/1.1
   28: Host: {$host}
   29: 
   30: 
   31: HEADER
   32: )) {
   33: 	while (!feof($fp)) {
   34: 		$output .= fgets($fp);
   35: 	}
   36: }
   37: echo $output;
   38: @unlink($dir . "/syntax_error.php");
   39: fclose($fp);
   40: ?>
   41: --EXPECTF--
   42: HTTP/1.1 200 OK
   43: Host: %s
   44: Connection: close
   45: X-Powered-By: PHP/%s
   46: Content-type: text/html
   47: 
   48: <br />
   49: <b>Fatal error</b>:  Call to undefined function non_exists_function() in <b>%ssyntax_error.php</b> on line <b>%s</b><br />

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>