Jump to content
  • Hello visitors, welcome to the Hacker World Forum!

    Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

    TheHackerWorld Official

Recommended Posts

原文链接:vscode+phpstudy配置php环境 – 每天进步一点点 (longkui.site)

上一篇文章中借助phpstudy搭建了php环境,并成功新建了一个网站。这篇文章简单介绍一下,如何借助vscode搭建php开发环境。

我们打开vscode,下载一个php Debug插件,这个插件主要是为了我们以后方便调试用。

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022043006.png

然后我们打开“文件”—>”首选项”——>”扩展”

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022043007.png

我们往下拉,找到php,然后打开setting。

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022043008.png

加入类似下面的设置,注意,不要复制我的,填写你自己php.exe的路径。

    "php.debug.executablePath": "D:/Software/phpstudy/main/phpstudy_pro/Extensions/php/php7.3.4nts/php.exe",
    "php.validate.executablePath": "D:/Software/phpstudy/main/phpstudy_pro/Extensions/php/php7.3.4nts/php.exe",

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022050201.png

然后,我们用VScode 打开phpstudy创建的项目目录,双击就能打开目录路径,然后用vscode打开这个路径。

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022050202.png

注意:不要打开一个文件,而是打开一个目录。

我们在这个目录里新建一个php文件,里面内容如下:

<?php
$a = 'hello world';
echo $a;
?>

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022050203.png

然后在浏览器里输入:localhost/hello.php

就可以看到下面的内容了。

http://kongkui.oss-cn-qingdao.aliyuncs.com/images/2022050204.png

Link to post
Link to comment
Share on other sites

 Share

discussion group

discussion group

    You don't have permission to chat.
    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...