YII2 Day 2: Configuring Phpstorm

Source: Internet
Author: User

XDebug Configuration

Yii2 so much code, inevitably need to track debugging place, so xdebug is essential. Since XAMPP has been extended with Xdebu, it is only necessary to change the next php.ini file to enable this extension:

Zend_extension = "D:\xampp\php\ext\php_xdebug.dll" (as determined by the actual situation) xdebug.remote_enable =1xdebug.remote_handler = "DBGP" Xdebug.remote_host = "localhost" Xdebug.remote_mode = "req" Xdebug.remote_port = 9000

After enabling the extension, you can use Phpinfo to see if there is this extension. After that, it is guaranteed that PHP debugging information can be sent to the Remote_host Remote_port port. Then configure Phpstorm:

    1. Enter File>settings>php>servers, here to fill in the server side of the relevant information:
      Name:localhost,
      Host:localhost,
      PORT:80,
      Debugger:xdebug
    2. Go to File>settings>php>debug, find the Xdebug tab, Port 9000
    3. Enter FILE>SETTINGS>PHP>DEBUG>DBGP Proxy to fill in:
      IDE Key:phpstorm
      Host:localhost
      Port:80
    4. Setup is complete, click OK to exit.

At this point, in fact, Xdebug and Phpstorm debugging preparation work has been completed, then there are two ways to achieve Phpstorm breakpoint debugging, method one:

PHP WEB Application

Run>edit configurations ... In the popup window, add a Debug configuration:

    1. Click the plus sign in the upper left corner to select PHP Web application

    1. Fill in the appropriate information in the right window:

    1. After filling out, click OK to close the Configuration window, point to the small beetle start debugging

Browser plugin

If you use Chrome or Firefox, you can install the browser plugin, which is the plugin for Chrome:

Click Options, open the Plugins Options page, set the following:

After installation, open http://localhost, you will see the browser address bar to the right of a small icon, click, select Debug:

In the Phpstorm, find the phone icon next to the Beetle, enable:

Set up, in the code to find a place to set a breakpoint, refresh the page, you should be able to stop. Then use a variety of debugging techniques to follow the debugging.

YII2 Day 2: Configuring Phpstorm

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.