< Install PHP Eclipse PDT on Windows XP | Main Java & Gang | Install MySQL on Windows XP Pro >

 


 

 

 

ECLIPSE PHP DEVELOPMENT TOOL (PDT) AND WORDPRESS

 

 

 

In this section we would like try to edit wordpress using Eclipse PDT. The machine specifications used in this task are:

 

  1. Intel Pentium Core 2 Duo, 2.2 GHz.
  2. Windows XP Pro SP2 + periodical patches + periodical updates
  3. 2 GB DDR2 RAM.
  4. 160 GB SATA HDD.
  5. 17” SyncMaster 713N monitor.
  6. Eclipse PDT.
  7. PHP 5.3.2 for Windows.
  8. Apache 2.2.x.

 

 

1.      First of all download wordpress from wordpress.org. Uncompress the zip file and the following are wordpress folders and files.

 

eclipse PHP PDT and wordpress testing

 

2.      Launch PDT and create a new PHP project.

 

eclipse PHP PDT and wordpress testing

 

3.      Name the project as wordpress to match the uncompressed wordpress folders and files. Other settings set to default. Click Next.

 

eclipse PHP PDT and wordpress testing

 

4.      Nothing was set here. Click Finish.

 

eclipse PHP PDT and wordpress testing

 

5.      In the PHP Explorer we can see the wordpress project node.

 

eclipse PHP PDT and wordpress testing

 

6.      The following Figure shows our wordpress project folder’s content as seen in Windows explorer.

 

eclipse PHP PDT and wordpress testing

 

7.      Next we will try to import all the wordpress folders and files into our PHP wordpress project. Select and right click the wordpress node > select Import sub menu.

 

eclipse PHP PDT and wordpress testing

 

8.      Choose General > File System. Click Next.

 

eclipse PHP PDT and wordpress testing

 

9.      Click Browse button at the end of the From Directory: field.

 

eclipse PHP PDT and wordpress testing

 

10. Select the wordpress folder and click OK.

 

eclipse PHP PDT and wordpress testing

 

11. Select the wordpress folder in the left window. This will select all folders and files contain in the wordpress folder. Click Finish.

 

eclipse PHP PDT and wordpress testing

 

12. The following Figure shows the wordpress folder being imported into our PHP wordpress project.

 

eclipse PHP PDT and wordpress testing

 

13. Well, there are 29 errors and hundreds warnings.

 

eclipse PHP PDT and wordpress testing

 

14. However, when we investigate those errors and warnings, all are 'bogus'. PDT fail to recognize some of the PHP template based project.

 

eclipse PHP PDT and wordpress testing

 

15. Let try running this project. Click Run > Open Run Dialog menu.

 

eclipse PHP PDT and wordpress testing

 

16. We will use the previously configured web config file (testphp_config) with some editing (you can create new config file). Edit the File: and URL fields as shown below. Then click the Browse button.

 

eclipse PHP PDT and wordpress testing

 

17. Click the Configure button.

 

eclipse PHP PDT and wordpress testing

 

18. Click the Path mapping tab.

 

eclipse PHP PDT and wordpress testing  

 

19. Click the Add button.

 

eclipse PHP PDT and wordpress testing

 

20. Set the Path on Server to C:\Apache Software Foundation\Apache2.2\htdocs and Path in Workspace to /wordpress (use the Browse button).

 

eclipse PHP PDT and wordpress testing

 

eclipse PHP PDT and wordpress testing

 

21. Click the OK button.

 

eclipse PHP PDT and wordpress testing

 

22. Select the newly created path mapping and click OK.

 

eclipse PHP PDT and wordpress testing

 

23. Click the Run button.

 

eclipse PHP PDT and wordpress testing

 

24. Well, it works! In this case we do not setup the MySQL database yet. Click the Create a Configuration File.

 

eclipse PHP PDT and wordpress testing

 

25. The wordpress works nicely.

 

eclipse PHP PDT and wordpress testing

 

26. Other project settings can be set through the Preferences (Window > Preferences).

 

eclipse PHP PDT and wordpress testing

-----------------------------------------------------------------

 

--------------------------------------------------------------------------

eclipse PHP PDT and wordpress testing

 

27. There are two debuggers: Zend and Xdebug already bundled with PDT.

 

eclipse PHP PDT and wordpress testing - PHP debugger, XDebug and Zend Debug

 

28. What about Drupal? Drupal files have .module, .install etc extensions that do not recognized by PDT. For Drupal to work, you would need to associate .module, .theme, .engine files with PHP. This can be done using: Window > Prefrences > General > Content Types > Text > PHP Content Type. Then, click the Add button, add *.engine, *.install, *.module, *.theme one by one. Eclipse would now recognize all your drupal files and you should be able to debug them.

 

eclipse PHP PDT and wordpress testing - preferences

 

-----------------------------------------------------------------------------------------------------------------------

 

------------------------------------------------------------------------------------------------------------------------

 

eclipse PHP PDT and wordpress testing - defining new files

 

eclipse PHP PDT and wordpress testing - defining new files

 

29. Next, you may want to set the file association to the PHP editor. Select Preferences > General > Editors > File Associations, associate *.module and *.install with PHP Editor as shown in the following Figures.

 

eclipse PHP PDT and wordpress testing - defining new files

 

30. Firstly, click the Add button of the Associated Editors: list. Select the PHP Editor and click OK.

 

eclipse PHP PDT and wordpress testing - defining new files

 

31. Next, click the Add button of the File Types: list. Add the new file extensions.

 

eclipse PHP PDT and wordpress testing - defining new files

 

eclipse PHP PDT and wordpress testing - defining new files

 

32. You may want to try other IDEs for PHP such as Komodo IDE (commercial and free edition), HomeSite (commercial), Zend Studio (commercial), Aptana (opensource) and the latest version of NetBeans. PHPBB and PHPMyAdmin are another PHP based applications that you may want to try opening them in PDT.

 

 

 

 

 

 

 

 


 

< Install PHP Eclipse PDT on Windows XP | Main Java & Gang | Install MySQL on Windows XP Pro >