我想获得选项Run-> Launch With Firefox;打开我目前在Notepad ++中查看的文件,其格式为http://127.0.0.1:8080/currentfile.php
,但是它只是打开到Firefox中的当前文件目录。我尝试在Notepad ++目录中编辑快捷方式xml文件,并关闭了Notepad ++并编辑了带有普通记事本的XML文件,当我启动Notepad ++备份时,它不显示我输入的设置。我如何编辑设置以加载localhost而不是Firefox中的文件目录?配置Notepad ++在localhost上运行php?
回答
以及两件事情
你编辑了错误的文件,我猜你正在使用Windows Vista/7,真正的首选项文件位于C:\用户\用户\应用程序数据\漫游\记事本++
我不认为记事本+ +有一个只包含地址
意义的一半变量:现在使用的变量$(FULL_CURRENT_PATH)==文件:/// C:/服务器/H T docs/pages/example.php
所以你没有任何变量只包含这个页面/ example.php。
,所以我认为这是不可能
,但只要保持页面打开和编辑
刷新后如果直接保存你的PHP文件到WAMP的www目录(无子文件夹),你可以通过执行它选择“运行...”命令并粘贴到该行:
firefox.exe "http://localhost/$(FILE_NAME)"
这不是很好,但它会帮助你在jiffy中进行调试。
对于chrome.exe和其他任何东西都是一样的,因为我敢肯定对大多数人来说都是非常明显的大家。 – Codezilla
下面是运行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}");
这看起来很酷,但由于我不熟悉XML文件,也不知道如何从notepad ++ ++启动文件,所以我仍然试图找出如何实际运用它。 –
这完美谢谢 –
我知道这是一个老问题,但:
A. Gneady的解决方案运作良好。但是,它可能需要在Windows上进行一些修改,以便在替换斜杠方向之前替换DOCUMENT_ROOT。否则,不会进行替换,并且$ file将输出与原始路径和文件名相同的输出,但反斜杠除外。
由于我在多个浏览器测试,我修改所有相关的行中 C:\用户[用户名] \应用程序数据\漫游\记事本++ \ 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>
<Command name="Launch in IE" Ctrl="yes" Alt="yes" Shift="yes" Key="73">iexplore "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command>
<Command name="Launch in Chrome" Ctrl="yes" Alt="yes" Shift="yes" Key="82">chrome "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command>
<Command name="Launch in Safari" Ctrl="yes" Alt="yes" Shift="yes" Key="70">safari "http://localhost/redirect.php?file=$(FULL_CURRENT_PATH)"</Command>
然后,创建“重定向。在Web根目录下的PHP”文件如下:
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
$file = $_GET['file'];
$file = str_replace($root, '', $file);
$file = str_replace('\\', '/', $file);
header("Location: http://localhost{$file}");
?>
被遗忘标志/本地主机
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
$file = $_GET['file'];
$file = str_replace($root, '', $file);
$file = str_replace('\\', '/', $file);
# Was forgotten mark/
header("Location: http://localhost/{$file}");
?>
后,这是为我工作的代码:
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
$file = $_GET['file'];
$file = str_replace($root, '', $file);
$file = str_replace('\\', '/', $file);
$file = str_replace('C:/wamp64/www/', '', $file); // Cause 'localhost' is equal to 'C:/wamp64/www/' in my case.
header("Location: http://localhost/{$file}");
?>
谢谢大家。
- 1. 在Notepad ++上运行程序
- 2. 在rails上配置Notepad ++ for ruby
- 3. Symfony - 在localhost上配置现有项目
- 4. PHP 5.4可以在PHP 5.3上运行配置服务器
- 5. Notepad ++多个运行命令
- 6. Notepad ++未运行代码
- 7. 为什么font-awesome在localhost上运行,但不在web上运行?
- 8. Java配置不在eclipse上运行
- 9. Notepad ++在宏中使用“运行”命令
- 10. 在Notepad ++中运行Python的问题
- 11. 如何在localhost/<my_port>上运行Rails 3应用程序?
- 12. Eclipse运行配置 - 在单个配置中运行多个配置?
- 13. CanActivate路由在localhost上不在服务器上运行
- 14. 路由在localhost上运行,但不在生产服务器上
- 15. 无法在localhost中运行wcf服务
- 16. 网站在localhost上运行,当上传时不显示图像
- 17. resharper运行配置
- 18. Eclipse运行配置
- 19. 注销PHP在localhost上,但不在线
- 20. Javascript无法在localhost上运行,但它正在运行Live网站
- 21. 如何在不运行Webmatrix的情况下先运行localhost网站(PHP,ASP)
- 22. PHP SwiftMailer Localhost测试设置
- 23. SetWebHook在localhost在PHP
- 24. 如何在Apache php localhost:8888上运行Angular-CLI项目,而不是-prod版本
- 25. 如何运行Python脚本(使用Notepad ++)
- 26. Localhost,Eclipse,java applets和php代码;小程序未运行
- 27. 在mamp上运行php
- 28. 在iOS上运行PHP?
- 29. AuthLogic会话只能在localhost上运行:3000
- 30. ajax GET在localhost上运行,但不在线
只需要注意一下,你可能想要接受你问的8个问题中的一部分,如果你不这样做,你很可能不会得到答案选择一个答案。 – Steven
我不认为Notepad ++可以做到这一点。在浏览器中保持打开状态并按刷新是一件麻烦的事情吗? – Ryan
对不起,我对这个网站很新,我怎么接受我问的问题?只是为了将来的参考,当我问另一个问题..我欣赏btw的头,谢谢! – CLUEL3SS