Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to debug Hyperf by PhpStorm

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces PhpStorm how to debug Hyperf, the article is very detailed, has a certain reference value, interested friends must read it!

1. The first step of quick restart of Hyperf:

Click the button in the upper right corner of PhpStorm, as shown in the figure:

Step 2:

Click the add button in the upper left corner of the pop-up box, and then click PHP Script, as shown in the figure:

Step 3:

Fill in the information of the PHP script:

Name: script name. Here we call it HyperfFile: script path. We select hyperf.php under the bin folder under the Hyperf directory, and the path is: YourProject/bin/hyperf.phpArguments: script parameter. Here we can fill in the start startup command. If necessary, you can write some other Command LineInterpreter options: interpreter options. Here, Custom Working directory: custom working directory is not entered by default, and Environment variables: environment variable is not entered by default. The default is not to fill in what we need to do before Before launch:Activate tool window starts, by default.

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

Fill in the information above, as shown in the figure:

Just click Save.

Step 4:

Using the script information we just configured, click the upper right corner of PhpStorm, and select the Hyperf script you just configured, as shown in the figure:

When selected, click the start button next to it to run Hyperf, as shown in the figure:

This opens it successfully. Let's visit it and have a try, as shown in the figure:

Step 5:

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

Open the settings of phpstorm and click Keymap on the left to see what the Run shortcut key is under Tool Windows. Here I use Mac, as shown in the figure:

Mine is the command + 4 key, which can bring up the window where the script runs, as shown in the figure:

Then the restart command is Command + R, which is a bit like the refresh of the browser. If Windows puts the mouse over a green restart icon in the lower left corner, it will prompt the shortcut key, as shown in the figure:

So the coherent operation is: Command + 4 and Command + R can quickly restart the Hyperf service.

Configure the REST client interface request client of PhpStorm 1. Open the REST client client

Click the toolbar above PhpStorm, find the Tools, click the mouse over the HTTP client, and three options appear. We select Test RESTful Web Service and click as shown in the figure:

2. How to use it?

In fact, it is very simple, similar to the usage of postman, and the above parameters are also explained to you.

HTTP method: request method Host/Port: host or domain name address and port Path: interface path

If the method is shown in the figure, the request is successful:

The above is all the contents of the article "how to debug Hyperf in PhpStorm". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report