I'm using XAMPP Lite for USB Drive. I also found fully functional Netbeans portable version.

The problem is I can't install XDebug because of path problem. For ex. on my local PC server PHP.ini configuration file looks like that

[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 

As you see, all paths are absolute; I mean with drive letter. But I can't write absolute paths for USB flash drive.

My questions are:

  1. Is there any way to get work xDebug with Xammp Lite on USB flash drive?
  2. Any alternative debugger which works portable?
有帮助吗?

解决方案

Your best option may be to have a little batch script to automatically always assign the same drive letter when load it up in Windows. You can make this an auto-run from the USB drive itself - so that it's entirely portable.

Your script should look something like this:

@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

The above example was lifted from here - and you'll find a couple other examples there as well: http://www.techrepublic.com/forum/questions/101-220894/force-thumb-drive-or-flash-drive-to-same-drive-letter-each-time

其他提示

Is the relative path not solved your problem?

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

xdebug.profiler_output_dir = \temp

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top