我正在尝试获取选项 Run->Launch With Firefox;在 http://127.0.0.1:8080/currentfile.php
打开我当前在 Notepad++ 中查看的文件,但它只是打开到 Firefox 中的当前文件目录。我试过编辑 Notepad++ 目录中的快捷方式 xml 文件,我已经关闭 Notepad++ 并使用常规记事本编辑 XML 文件,当我启动 Notepad++ 备份时它不显示我输入的设置。我如何编辑设置以加载本地主机而不是 Firefox 中的文件目录?
最佳答案
这是运行 php 文件的快速但不完善的修复方法,即使它们位于文档根目录中的子目录中。在 shortcuts.xml 中:
<Command name="Launch in Firefox" Ctrl="yes" Alt="yes" Shift="yes" Key="88">firefox "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command>
然后在您的 Web 服务器文档根目录中创建文件“redirect.php”:
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
$file = str_replace('\\', '/', $_GET['file']);
$file = str_replace($root, '', $file);
header("Location: http://localhost{$file}");
关于php - 配置 Notepad++ 以在本地主机上运行 php?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7536238/