一、前期准备
1、Windows安装VSCode;
2、在VSCode中安装PHP Debug插件;
3、安装好Docker
4、在容器中安装Xdebug
①写一个展现phpinfo的php文件
<?php
phpinfo();
?>
②在浏览器上打开该文件
③复制所有信息丢到Xdebug: Installation instructions result
④提交之后会给出合适的版本并给出安装教程
1.Download xdebug-3.1.6.tgz
2.Install the pre-requisites for compiling PHP extensions.
On your RedHat system, install them with: yum groupinstall "Development tools" && yum install php-devel autoconf automake
3.Unpack the downloaded file with tar -xvzf xdebug-3.1.6.tgz
4.Run: cd xdebug-3.1.6
5.Run: phpize (See the FAQ if you don't have phpize).
6. Run: ./configure
7. Run: make
8. Run: cp modules/xdebug.so /usr/lib64/php/modules
9. Create /etc/php.d/99-xdebug.ini
//and add the line:
zend_extension = xdebug
xdebug.mode = debug xdebug.start_with_request = yes xdebug.client_port = 9000 xdebug.discover_client_host = true xdebug.client_host = 虚拟机ip
10.Restart the Apache Webserver
5.安装Remote-SSH
6.尝试远程连接
文章来源:https://www.toymoban.com/news/detail-689390.html
文章来源地址https://www.toymoban.com/news/detail-689390.html
到了这里,关于VScode远程连接主机的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!