A large number of similar prompts will appear on the website, but they can be displayed and run normally.
A simple line of code like the following will produce the above error:
$ Str = coderbolg;
Although this can be run sometimes, problems may occur in some cases. When you see this error message, you can find the word in the quotation marks and find it to find the problem. This is usually because the quotation marks should be left blank where the string is used, or the $ symbol is missing when the variable should be used.
The default time zone of php is incorrect. Try to add
The code is as follows: |
Copy code |
Date_default_timezone_set (PRC);/* Set the time to Beijing time, and php5 is the Greenwich Mean Time by default */
|
The system prompts Notice: Use of undefined constant PRC-assumed 'prc'. After PHP5.1.0, date_default_timezone_set is overwritten and PRC is invalid.
The code is as follows: |
Copy code |
Date_default_timezone_set ("Asia/Shanghai "); |
It is normal.
The code is as follows: |
Copy code |
<? Php Date_default_timezone_set ("Asia/Shanghai");/* Set the time to Shanghai time. php5 defaults to Greenwich Mean Time */ // Date_default_timezone_set ("Asia/Beijing"); // interestingly, Beijing time does not support Echo date ('H: I: s '); ?> |
These are PHP prompts rather than errors. PHP itself can be directly used without declaring variables in advance, but there will be prompts for UN-declared variables. Generally, when a website is a formal website, it will turn off the prompt and even the error message.
How to disable PHP prompts
Search for php. ini:
The code is as follows: |
Copy code |
Error_reporting = E_ALL Changed: Error_reporting = E_ALL &~ E_NOTICE |
There is another way to do this:
Add each file header
The code is as follows: |
Copy code |
Error_reporting (0 ); |
Although it is difficult to solve the problem, it can solve the problem. If the php error is disabled, we will solve the problem if we can find the error, because I wrote a piece of php code before. If a lot of errors occur, we disable it, which will affect the program performance.