How to solve the problem of no prompts and blank pages in PHP:
Many programmers have encountered blank pages when developing PHP page, comprehensive analysis, the blank page in PHP programming may be caused by the following reasons:
1. Logic error
Logic error It is the most difficult to rule out. On the surface, the code may appear legal and formal, but when it runs, it is not as expected. why? Maybe the writer didn't think comprehensively enough. After all, people are people and computers are computers. It is impossible for computers to run scripts completely according to human ideas. Here, I will tell you a better debugging method, which is to use the comment symbol "/* */" to comment out some codes and observe the running conditions, so as to eliminate errors one by one and finally find the location of the error code. In this case, if you want to completely eliminate logical errors, you won't be able to do it without patience, so you have to calm down and don't be anxious.
2. Syntax Error
You may ask, if there is a grammatical error, there will usually be an error message. Why is it blank? Of course, this is just an individual phenomenon. In some home page spaces, if you write PHP with grammatical errors, it will not give any prompts. The solution is also easy, just test it locally before uploading the file to find out the wrong code and correct it.3. Abuse of the error mask @
The error suppressor "@" is often used where errors may occur, but the suppressor is used too much or too much. If it is not the right time, it may lead to a blank and avoid it. Let’s take a look at the following two PHP scripts:Solution: Check the source code, there will be an error message there, and put error_reporting(0 )Fault tolerance has been deleted. In this way, the error code can be displayed directly
Recommended tutorial: "php tutorial"
The above is the detailed content of How to solve the problem of no php error prompt and blank page. For more information, please follow other related articles on the PHP Chinese website!