2012-04-12 146 views
0

我正在使用XAMPP Lite用於USB驅動器。我還發現功能齊全的Netbeans便攜版。便攜式PHP調試

問題是我無法安裝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. 有沒有什麼辦法讓工作與Xdebug的精簡版XAMMP USB閃存驅動器上?
  2. 任何可替代的調試器工作便攜式?
+2

不知道是否會工作,但你可以嘗試使用像「\路徑php \ ext \ php_xdebug「,它可能會假定驅動器號是PHP正在運行的任何驅動器(閃存驅動器)。 – Corbin 2012-04-12 03:42:38

回答

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

0

是不是相對路徑解決了你的問題?

的zend_extension = 「\ PHP \分機\ php_xdebug.dll」

xdebug.profiler_output_dir = \ TEMP