PHP program error page blank no error prompt how to solve?

Source: Internet
Author: User
Tags sql error
Php page blank we start with several methods, one is that php closes the error reminder function, the other is that the program does not return results, of course, if php is used to operate the database, we can report errors to the database and make no judgment. here we will analyze these three methods for you... php page blank we start with several methods, one is that php closes the error reminder function, the other is that the program does not return results, of course, if php is used to operate the database, we can report errors to the database without judgment. here we will analyze the three methods for you to solve the problem of no errors on the php page.

1. php program does not report an error

For windows, find the php under the apache installation directory. ini, display_errors = Off changed to display_errors = On, linux system PHP configuration file path:/uer/local/php/etc/php. ini

Display_errors = Off to display_errors = On

Is there a program that includes:

Error_reporting = E_ALL;/* The strictest error reporting level, which can be enabled during development */

Error_reporting = E_ALL &~ E_NOTICE/* errors other than notice */

Error_reporting = E_ERROR | E_PARSE | e_CORE_ERROR/* only the fatal runtime error is considered. new parsing error

If they exist, cancel them.

2. no results are returned for php program executionThe sample code is as follows:

function abc() {     echo 'http://www.phprm.com'; }

You can directly execute the page as a blank page. we need to execute the call function.

Echo abc.

3. Database SQL errorBut no error report prompt is provided. the sample code is as follows:

$sql ="select * from a where aaaaf=ccc ";mysql_query( $sql );

In this way, if an SQL execution error occurs, but no error occurs, we only need to add mysql_error.

$sql ="select * from a where aaaaf=ccc ";mysql_query( $sql ) or die(mysql_error());

Friendly reminder: some time may be due to page encoding errors or blank pages, but the error reminder function is still displayed.


Tutorial address:

Reprinted! But please include the article address ^

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.