This setup allows you to edit and debug you PHP files along with your flex application in the same instance of eclipse. All features of PDT like PHP code coloring, auto complete will be available in addition to the wonderful features that Flash Builder 4 providesJ.
1. Download Eclipse 3.4.2 based PDT All-in-One bundle
a. Windows
b. Mac OSX Carbon
2. Extract it to a location of your choice. (say C:\opt\eclipse)
3. Download XDebug dll from http://xdebug.org/download.php. For the purposes of this tutorial I downloaded and used http://xdebug.org/files/php_xdebug-2.0.4-5.2.8.dll
4. Place this dll at any location accessible by your php installation, the PHP home directory itself is a good location.
5. Add the following entries to your php.ini file:
;
; Changes to enable XDebug
;
zend_extension_ts="C:/opt/php526/php_xdebug-2.0.4-5.2.8.dll"
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="C:/temp"
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_host=127.0.0.1
xdebug.remote_mode=req
xdebug.remote_log="C:/temp"
You need to be extra careful while editing the php.ini file as installations like WAMP tend to have a php.ini file inside the php folder and another one inside the apache/bin folder. The one under apache/bin is used. So a good way to figure out which php.ini file is being used by your PHP installation run phpinfo() and check the value of “Loaded Configuration File”

6. Restart your web server and view the phpinfo() output. XDebug should be listed there. If you don’t have a phpinfo() file, you can create one by putting the text below in a php file and saving it under your webroot. Then load the file in your browser.
<?php
phpinfo();
?>

7. Now download the plug-in version of Flash Builder and install it. When prompted to select the host eclipse, choose the “Plug into another copy of Eclipse” option and enter the path of the eclipse installed in Step 2 – “C:\opt\eclipse”

8. Start eclipse and create a new Flex Project with server type PHP
9. Create/Import a new PHP service the flex project
10. Click on the filters icon at the top of the flex package explorer and uncheck some .* & .project

11. Create a .buildpath file right under the Flex Project and add the following content to it, take care not to overwrite the text in BOLD in your .project file:
<?xml version=”1.0″ encoding=”UTF-8″?>
<buildpath>
<buildpathentry kind=”src” path=”services”/>
<buildpathentry kind=”con” path=”org.eclipse.php.core.LANGUAGE”/>
</buildpath>
12. Update your project’s .project file to look like this:
<?xml version=“1.0″ encoding=“UTF-8″?>
<projectDescription>
<name>PdtFlexTest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.adobe.flexbuilder.project.flexbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.adobe.flexbuilder.project.flexnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
<nature>org.eclipse.php.core.PHPNature</nature>
</natures>
<linkedResources>
<link>
<name>bin-debug</name>
<type>2</type>
<location>C:/projects/www/htdocs/PdtFlexTest-debug</location>
</link>
<link>
<name>services/TestService.php</name>
<type>1</type>
<location>C:/projects/www/htdocs/PdtFlexTest-debug/services/TestService.php</location>
</link>
</linkedResources>
</projectDescription>
13. Now click on the Debug menu and go to Debug configurations, create a new “PHP Web Page” debug configuration.

14. Click on debug, the browser will open and this debug session in PDT will wait for the service class to be invoked.
15. Now launch your flex application which uses this services, the PDT debugger should break at the first line of gateway.php. In case you would like the debugger to break on a breakpoint in the service class, uncheck the “Break at First Line” option in the Debug launch configuration and place a break point on the exact line in the service file where you would like the debugger to stop.
That’s all there is to it J. You can now edit your PHP code and Flex code in the same instance of eclipse. Full coloring, autocomplete and other PDT feature support for editing your PHP file in addition to all the awesome features of Flash Builder for editing you Flex applications J.
Enjoyyy!!!