PHP Log function Error_log

Source: Internet
Author: User
Tags log log

PHP built-in function to print log logs, which is very efficient for PHP program debugging

1. Configuration

Edit PHP.ini File

Log_errors = On

Setting the log log storage path

Error_log =/wwwroot/php_errors.log

2. Create Php_errogs.log

3. Assigning Permissions

Chmod-r 777 Php_errogs.log

4. Restart PHP-FPM

Service PHP Restart

5. Testing

Create a demo.php file

Error_log (' Test log log write '), $arr = Array (' a ' = ' = ' Test ', ' b ' = ' log write '); Error_log (Print_r ($arr, true));

  

?

The contents of the file are as follows:

[14-sep-2016 08:04:07 UTC] Test log log Write

[14-sep-2016 08:05:45 UTC] Array

(

[A] = Test

[b] + = log Write

)

PHP Log function Error_log

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.