Home > Development Tools > phpstorm > PhpStorm's elegant debugging Hyperf

PhpStorm's elegant debugging Hyperf

coldplay.xixi
Release: 2020-07-02 17:34:38
forward
4658 people have browsed it

PhpStorm's elegant debugging Hyperf

Foreword:

I also learned this method after watching Huang Daozhu’s live broadcast last night. I took advantage of the break at noon today to practice this technique. Share it with everyone. When you are debugging Hyperf, you may always need to restart some services and click the interface request button of postman again to check whether the debugging results are normal. This article is to teach you How to complete this series of operations in PhpStorm.

Related learning recommendations: phpstorm usage tutorial

1. Hyperf quick restart

Step one:

ClickPhpStorm The button in the upper right corner, as shown in the picture:

PhpStorms elegant debugging Hyperf

##Step 2:
Click on the upper left corner of the pop-up box Click the Add button in the corner, and then click

PHP Script, as shown in the figure:
PhpStorms elegant debugging Hyperf

PhpStorms elegant debugging Hyperf

Step 3:
Fill in the information of the PHP script:

Name:脚本名称,这里我们取名叫Hyperf

File:脚本路径,我们选择Hyperf目录下,bin文件夹下的 hyperf.php,路径为:YourProject/bin/hyperf.php
Arguments:脚本参数,这里我们填写 start 开启命令就行了,如果有需要可以写一些别的

Command Line
Interpreter options:解释器选项,这里默认不填写
Custom Working directory:自定义工作目录,这里默认不填写
Environment variables:环境变量,这里默认不填写

Before launch:Activate tool window
启动前,我们需要做的事,默认不填写
Copy after login

If there is a pop-up option for you to choose a fix, you only need to open it and select the corresponding PHP version

After filling in the above information, as shown in the picture:

PhpStorms elegant debugging HyperfClick save.

Step 4:
Use the script information we just configured, click the

PhpStorm upper right corner, and select the Hyperf script just configured, such as Picture:

PhpStorms elegant debugging HyperfAfter selecting, click the start button next to it to run
Hyperf, as shown in the picture:

PhpStorms elegant debugging Hyperf

PhpStorms elegant debugging HyperfThe activation is successful. Let’s visit and try, as shown in the picture:

PhpStorms elegant debugging Hyperf##Step 5:

Use shortcut keys to restart quickly (my method here may not be the easiest, please improve it if there is a simpler one~)
Open the settings of

phpstorm
, click Keymap on the left, and view under Tool Windows What is the Run shortcut key? Here I am using a Mac, as shown in the picture:

PhpStorm 如何优雅的调试 HyperfMy key is command 4, which can bring up the window where the script runs, as shown in the picture :

PhpStorm 如何优雅的调试 HyperfThen the restart command is Command R, which is a bit like refreshing a browser. For Windows, put the mouse on the green restart icon in the lower left corner, and a shortcut key will be prompted. , as shown in the figure:

PhpStorm 如何优雅的调试 Hyperf Such a coherent operation is:

Command 4 and Command R

to quickly restart the Hyperf service. 2. Configure PhpStorm's REST client interface to request the client

1. Open the REST client

Click on the toolbar above
PhpStorm

and find Tools After clicking, place the mouse on HTTP client, three options will appear, we choose Test RESTful Web Service After clicking it, it will look like this:

PhpStorms elegant debugging Hyperf2. How to use?

is actually very simple. It is similar to the usage of
postman

. Let me explain the above parameters to you! <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false;">HTTP method:请求方式 Host/Port:主机or域名地址和端口 Path:接口路径</pre><div class="contentsignin">Copy after login</div></div>The usage method is as shown in the figure, which means the request is successful: </p> <p><br></p> <h3>Conclusion: </h3> <p>Although this tutorial is very simple and has no technical content, it is still released to the community to help more learners who are new to <code>Hyperf to learn and make progress together. !             

#

The above is the detailed content of PhpStorm's elegant debugging Hyperf. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template