gpt4 book ai didi

php - 将当前文件作为 PHP 脚本运行

转载 作者:可可西里 更新时间:2023-11-01 11:26:00 27 4
gpt4 key购买 nike

有没有办法在 Visual Studio Code 中将当前 *.php 文件作为 PHP 脚本运行?我发现的信息表明,如果您安装了 Xdebug,就可以调试代码,但感觉很奇怪,您不能运行代码。

(这是 2000 年前后所有编辑器的标准功能,但现在越来越难找到了...)

最佳答案

我会说编辑器没有这样的功能,因为有一个实现它的第三方扩展......你需要安装 Runner .然后,Ctrl+Shift+R输出 Pane 中启动脚本:

screenshot

PHP 配置out of the box :

const defaultLanguageMap = {
bat: '',
clojure: 'clj',
go: 'go run',
javascript: 'node',
lua: 'lua',
perl6: 'perl6',
perl: 'perl',
php: 'php',
powershell: 'powershell -noninteractive -noprofile -c -',
python: 'python',
r: 'Rscript',
ruby: 'ruby',
shell: 'bash',
typescript: 'tsc'
};

关于php - 将当前文件作为 PHP 脚本运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36219346/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com