Experience in the debugging of Yii framework--_php tips for executing SQL statements in page output

Source: Internet
Author: User

We use: YIIDEBUGTB to debug (because with his interface is more beautiful, do not affect the other elements of the interface).

1. Download the YIIDEBUGTB and put it into the APPLICATION.EXTENSIONS.YIIDEBUGTB directory

2. Modify main.php and add the following code:

Copy Code code as follows:

' Log ' =>array (
' Class ' => ' Clogrouter ',
' Routes ' =>array (
Array
' Class ' => ' Cfilelogroute ',
' Levels ' => ' Error, Warning,trace ',
),

Here's the new plus
Array (//configuration for the toolbar
' Class ' => ' Xwebdebugrouter ',
' Config ' => ' alignleft, opaque, Runindebug, Fixedpos, collapsed, Yamlstyle ',
' Levels ' => ' Error, warning, trace, profile, info ',
' Categories ' => ' system.db.* ',
' Allowedips ' =>array (' 127.0.0.1 ', ':: 1 ', ' 192\.168\.1[0-5]\.[ 0-9]{3} ', ' If the program needs to fill in your public network IP ' in the net,
),

),
)

3.db link configuration inside to make the following modifications:

Copy Code code as follows:

' DB ' =>array (
' connectionString ' => ' mysql:host=*.*.*.*;d bname=test ',
' Emulateprepare ' =>true,//Join
' Enableparamlogging ' => true,//Join
' username ' => '-----',
' Password ' => '---',
' CharSet ' => ' UTF8 ',
' schemacachingduration ' => ' 0 ',
' AutoConnect ' =>false,
),

4. Complete

Such as:

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.