For more information, see socket communication in php. In-depth explanation: socket communication in php 1. Common Errors in php 1. syntax errors * 1). less semicolons * 2 )....... 2. environment error * 1). php configuration wait 3. logic error introduction: php socket communication
1. Common Errors in php
1. Syntax error
* 1). write less semicolons
* 2 ).. .....
2. environment error
* 1). php configuration waiting
3. logical error
* 1) to use an equal sign, two equal signs are used in the result.
2. defined error types
| Error name |
Error Description |
E_ALL |
All errors and reports |
E_ERROR |
Fatal runtime error. script execution is |
E_WARBING |
Run-time warning (non-fatal), script execution will not be paused |
E_PARSE |
Parsing error during compilation |
E_NOTICE |
Runtime reminder |
E_STRICT |
Start php's code modification suggestions to ensure the best code interoperability and forward compatibility |
E_DEPRECATED |
Runtime notification. after startup, a warning will be given to code that may not work properly in future versions. |
E_CORE_ERROR |
Fatal error occurred during php startup initialization |
E_CORE_WARNING |
Warning error (non-fatal) during php startup initialization) |
E_COMPILE_ERROR |
Fatal errors during compilation |
E_COMILE_WARNING |
Compile-time warning (non-fatal error) |
E_USER_ERROR |
Error message generated by the user |
E_USER_WARNING |
User-generated warning message |
E_USER_NOTICE |
User-generated reminder message |
E_USER_DEPRECATED |
User-generated warning information, similar to E_DEPRECATED,trigger_errorFunction generation |
E_RECOVERABLE_ERROR |
A captured error indicates that a very dangerous error may occur, but the PHP engine is not unstable yet. If the error is not captured by the custom handle (seeset_error_handler()), And the script stops running. |
3. error levels in php
1.Deprecated (not recommended | outdated)Error
* 1 ).Lowest-level errorsFor exampleeregFunction, mysql_escape_string
* 2 ).Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
2.NoticeNotification-level error
* 1). access undefined variables
* 2) when accessing the array, $ arr ["name"]; the program first queries the constant name. if not found, the program treats the name as a string.
3.WarningWarning-level error
* 1) the number of parameters is incorrect.
* 2) the parameter type is incorrect.
4.Fatal errorFatal errors(Terminate the program to continue execution)
* 1). call undefined functions
* 2) the parameter type is incorrect.
5.parse errorSyntax parsing error
* 1). The check phase fails, and no other errors will be seen, because it is not yet there,The program has not been resolved successfully.
6.E_USER _ related errors
* 1). The check phase fails, and no other errors will be seen, because it is not yet there,The program has not been resolved successfully.
4. error-related options in the php configuration file
| Option |
Description |
| Error_reporting |
Set the error report level |
| Display_error |
Show error? |
| Log_errors |
Set whether to record the generated error information to the log or error_log |
| Error_log |
Set an error log storage file |
| Log_errors_max_len |
Set the maximum number of log_errors bytes |
| Ignore_repeated_errors |
Ignore duplicate error messages? |
| Ignore_repeated_source |
Ignore duplicate message sources |
| Track_errors |
If this option is enabled, the last error will always be saved in$php_errormsgMedium |
5. how to set the error level
1. modify the error_reporting value in the configuration file.
2. PassError_reporting functionSet
* 1. error_reporting (0); no error is displayed, except for E_PARSE
* 2. error_reporting (-1) | error_reporting (E_ALL) show all errors
3. use ini_set ('error _ report', 0) to set
6. suppress error output symbols
@
1.@Settype ()
7. PHP errors returned by trigger_error
The function of triggering an error is not only limited to the php parser, but also
trigger_error()Function trigger error. Trigger_error ('error information', custom error, for example: (E_USER_NOTICE) trigger_error ('custom error information', E_USER_NOTICE); this function does not interrupt the program to continue execution.
Errors 1. Common Errors in php 1. syntax errors * 1). write less semicolons * 2 ).. ..... 2. environment error * 1). php configuration wait 3. logic error...