Home > php教程 > php手册 > body text

php程序页面空白问题排查方法详解

WBOY
Release: 2016-05-23 13:07:27
Original
1168 people have browsed it

很多初学者会发现在执行php时会发现页面什么出没有输出了,是一个空白的页面,出现这种问题是程序错误所导致了,那么我们要如何来找出程序的错误呢?

原因分析:如果你程序有问题而我们执行时没有提醒错误,那么有几种可能.

1.php.ini中错误提醒功能关闭,我们只要开启即可

找到display_errors = On 修改为 display_errors = off

2.在php程序相关页面也加了关闭错误报错功能,我们去掉相关代码即可

ini_set("display_errors", "On");

当然如果你没有权限来做这些操作我们可以使用echo 排查法来解决,代码如下:

<?php 
	$action = $_GET[&#39;id&#39;]; 
	if($action == &#39;&#39;) 
	$action = 1; 
	if($action == 1) { 
	echo("/$action&#39;s value is 1"); 
	} else if($action == 2) { 
	echo("/$action&#39;s value is 2"); 
	}   
	
Copy after login


本文地址:

转载随意,但请附上文章地址:-)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template