【问题标题】:Portable PHP Debug便携式 PHP 调试
【发布时间】:2012-04-24 09:58:05
【问题描述】:

我将 XAMPP Lite 用于 USB 驱动器。我还发现了功能齐全的 Netbeans 便携版。

问题是由于路径问题我无法安装 XDebug。例如。在我的本地 PC 服务器上PHP.ini 配置文件看起来像这样

[zend]
zend_extension = "C:\Program Files (x86)\PHP\ext\php_xdebug.dll"
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.profiler_enable = On 
xdebug.profiler_output_dir = C:\Windows\temp 
xdebug.dump_globals=On 
xdebug.show_exception_trace=On 
xdebug.collect_params=4 

如您所见,所有路径都是绝对的;我的意思是驱动器号。但我不能为 USB 闪存驱动器编写绝对路径。

我的问题是:

  1. 有什么方法可以在 USB 闪存驱动器上使用 Xammp Lite 进行 xDebug 工作?
  2. 任何可移植的替代调试器?

【问题讨论】:

  • 不确定它是否会工作,但你可以尝试使用类似“\php\ext\php_xdebug”的路径,它可能会假设驱动器号是 PHP 正在运行的任何驱动器(闪存驱动器) .

标签: php netbeans xampp xdebug portable-applications


【解决方案1】:

您最好的选择可能是有一个小批处理脚本,以便在 Windows 中加载时自动分配相同的驱动器号。您可以从 USB 驱动器本身使其自动运行 - 使其完全便携。

您的脚本应如下所示:

@echo off

set NewLetter=X

@REM Find the (USB) drive with the flagfile "USB.root" and change its drive letter to "%NewLetter%"

@REM Abort if %NewLetter% already exist
if exist %NewLetter%: goto END_USB_DRIVE

if not exist "%SystemRoot%\System32\DISKPART.EXE" goto END_USB_DRIVE

@REM Find the drive with the flag file and set %_USBroot% to the old letter
for %%i in (c d e f g h i j k l m n o p q r s t u v w y z) do (
if exist %%i:\USB.root set _USBroot=%%i:
)
@REM Abort if no Drive with the flag file has been found
if "%_USBroot%" == "" goto END_USB_DRIVE

@REM Create the script file for DiskPart.exe on the USB-drive
echo select volume %_USBroot<> "%_USBroot%\ChangeDrvLetter.txt"
echo assign letter=%NewLetter<>> "%_USBroot%\ChangeDrvLetter.txt"

@REM Do the change -> %NewLetter%
DISKPART /S "%_USBroot%\ChangeDrvLetter.txt"
if exist "%NewLetter%:\ChangeDrvLetter.txt" del "%NewLetter%:\ChangeDrvLetter.txt"

:END_USB_DRIVE

上面的例子是从这里提取的 - 你还会在那里找到其他几个例子:http://www.techrepublic.com/forum/questions/101-220894/force-thumb-drive-or-flash-drive-to-same-drive-letter-each-time

【讨论】:

    【解决方案2】:

    相对路径没有解决你的问题吗?

    zend_extension = "\PHP\ext\php_xdebug.dll"

    xdebug.profiler_output_dir = \temp

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-01
      • 2011-02-20
      • 2016-06-20
      相关资源
      最近更新 更多