A simple explanation: PHP socket Communication

Source: Internet
Author: User
Tags continue deprecated execution log parse error php error save file socket

1. Common types of errors in PHP

1. Grammatical errors
* 1). Write less semicolons
* 2). 。 。。。。。

2. Environmental error
* 1). PHP Configuration Wait

3. Logic Error
* 1). To use an equal sign, the result uses two equal signs

2. Types of errors that have been defined

Wrong name Error Description
E_ALL All the errors and reports
E_ERROR Fatal run-time error, the execution of the script is
E_WARBING Runtime Warning (non-fatal), execution of script will not be paused
E_PARSE Compile-Time Parse error
E_NOTICE Run-time Reminders
E_STRICT Start PHP Modifications to your code to ensure optimal interoperability and forward compatibility for your code
E_DEPRECATED Runtime notification, which warns you of code that might not work correctly in future versions
E_CORE_ERROR Fatal error occurred during initialization of PHP at startup
E_CORE_WARNING Warning Errors (non-fatal) that occur during initialization of PHP at startup
E_COMPILE_ERROR Compile-time fatal error
E_COMILE_WARNING Compile-time warnings (non-fatal errors)
E_USER_ERROR User-generated error messages
E_USER_WARNING User-generated warning message
E_USER_NOTICE User-generated reminder message
E_USER_DEPRECATED A user-generated warning message similar to e_deprecated, but generated by atrigger_errorfunction
E_RECOVERABLE_ERROR A specified error that could be caught, she said that a very dangerous error might have occurred, but had not caused the PHP engine to be in an unstable state. If the error is not captured by the user's custom handle (seeset_error_handler()), it becomes a e_error and the script terminates.

Error level in 3.php

1.deprecated (deprecated)error
* 1).the lowest level error, such as using theeregfunction, 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 variable
* 2). When accessing an array, $arr ["name]"; The program first executes the lookup constant name and, if not found, treats the name as a string

3.WarningWarning Level error
* 1). The number of parameters is not
* 2). The parameter type is not

4.Fatal Errorfatal level error(terminate program continue)
* 1). Call undefined function
* 2). The parameter type is not

5.Parse errorsyntax resolution error
* 1). The check phase does not pass and no other errors are seen because theprogram has not yet resolved successfully

6.E_user_-related errors
* 1). The check phase does not pass and no other errors are seen because theprogram has not yet resolved successfully

4. Error-related options in PHP configuration file

Options Description
Error_reporting Set the level of error reporting
Display_error Whether to display errors
Log_errors Sets whether the error messages that are generated are logged to the log or error_log
Error_log To set the save file for the error log
Log_errors_max_len Sets the maximum number of bytes for log_errors
Ignore_repeated_errors Whether to ignore duplicate error messages
Ignore_repeated_source Whether to ignore duplicate message sources
Track_errors If this option is turned on, the last error will always be saved in$php_errormsgthe

5. How to set the error level

1. Modify the value of error_reporting in the configuration file

2. In code byerror_reporting function setting
* 1.error_reporting (0); Do not show errors except E_parse
* 2.error_reporting ( -1) error_reporting (e_all) Displays all errors

3. Use Ini_set (' error_reporting ', 0) function runtime settings

6. Suppress Error output symbols@

1.@Settype ()

7. Go through trigger_error PHP error

the ability to trigger errors is not limited to PHP parsers, but can alsotrigger_error()trigger errors through functions. Trigger_error (' Error message ', custom error, such as: (E_user_notice)) trigger_error (' Custom error message ', E_user_notice); The function does not interrupt the program to continue execution.

Related Article

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.