Failed loading php_xdebug message

user1530385 picture user1530385 · Jul 27, 2012 · Viewed 7.8k times · Source

When I run php from the command line (on Windows), I receive the following message

Failed loading C:\Users\Nickey K\Documents\AMD APP\bin\x86_64;C:\Users\Nickey K\ Documents\AMD APP\bin\x86;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program F iles (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Window s Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Prog ram Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C :\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program F iles (x86)\Calibre2\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core- Static;C:\Program Files (x86)\EasyPHP-12.0\php\php544x120715104042;\php\php544x1 20715104042\php_xdebug-2.2.0-5.4-vc9.dll

x_debug seems to be installed properly based on phpinfo, and I have the following line in php.ini

zend_extension = "C:\Program Files (x86)\EasyPHP-12.0\php\php544x120715104042\php_xdebug-2.2.0-5.4-vc9.dll"

I've put the dll file in both the above the the ...\ext directory and tried a few variants of the above line, but I'm unable to get rid of this error message.

Any ideas?

Answer

Anand picture Anand · Oct 30, 2012

The regular command line PHP from EasyPHP did not work as is. The problem is EasyPHP replaces the PATH variable with its own. That is just dumb that it doesn't use a different variable.

But, the following worked for me after some experimentations. I created a batch file php5.bat and placed it in C:\Windows\Sytem32 for easier access, with the following code (where C:\Program Files (x86)\EasyPHP-12.1\php\php548x121030011600 is the location my easyPHP php.exe was).

@echo off
REM Set the path for easy PHP and then start PHP.
set OLD_PATH=%PATH%
set PATH=C:\Program Files (x86)\EasyPHP-12.1
set PHP_DIR=C:\Program Files (x86)\EasyPHP-12.1\php\php548x121030011600
call "%PHP_DIR%\php.exe" -c "%PHP_DIR%\php.ini" %*
set PATH=%OLD_PATH%
@echo on

And then calling the batch file php5 -v will give you the php version. You might need to copy some DLLs from the Apache folder into the PHP folder as it will complain the DLLs are not found.