Eclipse PHPEclipse XAMPP Installation Notes

Eclipse PHPEclipse Drupal Setup – the IBM version – is old. Better to use XAMPP install as it has everything and appears PHPEclipse already assumes its usage although it can be altered to use custom installs of Apache / MySQL / PHP – This article stops short in that it does not tell you how to run from within Eclipse. Maybe that is because it does not instruct on how to install a debugger. ( not sure )

Point XAMPP at your workspace – edit apache httpd.conf file. Default workspace location is \xampp\htdocs – All projects must be defined in the workspace directory so that PHP files can be found by the Apache Web Server. You cannot create PHP projects in other parts of the file system.

You should be able to run a version of your install on localhost now: http://localhost/YourWebSiteDirectory … it will default to index.php in that directory. You should run and verify operation

Next the Eclipse IDE needs to be set up so it can run the index.php script of the drupal install. See this Example for running PHP script … it is the german install but it is similar enough to see what to do. You need to point to the index.php file with the argument should point to the index.php file and include the directory path to it. At this point I observed that I could run and observe the text output of the php file run in the console tab.

You should have already saved the Xdebug extension DLL file to your PHP extension folder. Record down the full path of it. Now, open up your php.ini file and go down to the [XDebug] section, or create it if it’s not there. Uncomment or add the following lines:

The zend_extension_ts should point to location of your Xdebug extension DLL that you downloaded earlier; modify as appropriate. Then, you should disable the Xdebug entry in the list of dynamic extensions. This is confusing, but since we are already setting up Xdebug as a Zend extension, we don’t need another entry. Disable the Xdebug dynamic extension by ensuring the following line is commented out, like below:

;extension=php_xdebug.dll

There is one last very important step you need to do, particularly if you are running XAMPP. Current versions of Xdebug are incompatible with the Zend optimizer that is enabled by default in XAMPP, so you must disable that if you want Xdebug to work. If you don’t, you’ll notice that Apache will crash every time you try to load it with Xdebug enabled. To disable the Zend optimizer, find the [Zend] section in php.ini and comment out all of the entries under it, like so: (This is an example, there may be more to comment out)