反转旋木

反转旋木

时代的一粒尘埃,落在个人身上就是一座大山

Record a configuration of remote debugging for Baota PHP + Xdebug + VSCode.

Recording a configuration of Baota PHP + xdebug + vscode remote debugging#

The story is like this: a greasy company, a boss with a big gold chain, bald, fat, and old-fashioned tattoos, threw me a wedding network backstage and told me that it needs to be deployed on the server and told me that this is a project developed by his friend with a million investment, and he wants it to run.

I was confused at the time. Why would a game front-end developer like me have to deal with PHP, let alone the backend? Maybe he thought PHP was like a webpage and just threw it at me.

So, a friendly reminder to my friends, when looking for a job, don't choose companies with less than 6 people in the technical team (we only have 2, one front-end and one back-end). It's not easy to find a job where you can write code in a small city that is not a big city.

Secondly, take a look at what the best language in the world is like.

Deploying PHP web pages#

First, deploy Baota, and then it's mostly point-and-click operations (no need for Docker, killing a chicken doesn't require a big knife, and besides, if I leave, I guess there won't be many people in the company who can do it. In fact, I'm just lazy).

Install Baota, go to the official website, copy a command line and press enter

yum install -y wget && wget -O [install.sh](http://install.sh/) [https://download.bt.cn/install/install_6.0.sh](https://download.bt.cn/install/install_6.0.sh) && sh [install.sh](http://install.sh/) ed8484bec

Then install PHP, nginx, and MySQL, the necessary components

Untitled

Put it into the site, modify config.php, and create a database

Modify the pseudo-static

Untitled

The setup is quite simple. Let's visit it

Untitled

Now let's do Xdebug remote debugging#

Untitled

Actually, there is a pit here. To install xdebug3, you need to modify the configuration file. You can modify the corresponding php.ini if you know the location.

You can also modify it inside

Untitled

xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9993   #xdebug3 listening port (default is 9003)

Some of them are not explained on Baidu. This is actually for Xdebug2.

Untitled

Restart PHP afterwards

Install the remote extension in vscode and connect to the remote, then install two plugins

Untitled

Then create the launch.json file for vscode to run

Untitled

Select PHP

Modify the port to 9993, the same as the PHP configuration port above

Untitled

Run the test and see if it succeeds

Untitled

Actually, many of my colleagues used to directly display PHP debugging on the webpage. Maybe they are used to Unity debugging.

Epilogue#

One day, undoubtedly, I went to the seafood market and found

Untitled

I looked at the effect picture. It can't be said to be exactly the same. Hey, a million-dollar project.

This article is synchronized and updated to xLog by Mix Space
The original link is http://121.41.123.51:2333/posts/company/2


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.