Maybe this question is silly but I really don't know how to solve.

First, as other server, I want to define new server. So, in Eclipse, I go to: Windows>Preference>Server:

1) When I add new server, in list, no category for apache HTTP server. Just has apache tomcat. So, I click into download additional server adapter-->still don't have in list.

2) So, I search. I point to location I have installed. Good, Eclipse sees that is a HTTP Server. And Eclipse see folder to put project into for me (because I use LAMPP so that folder isn't in Apache folder).

But here is my problem. When I want to run a new PHP Project. Right click, run on server. A new dialog appear take me to choose which server to run. And, in list of server, no HTTP Server, So, I don't know how to choose Apache HTTP Server !!! (because Eclipse doesn't see which server that I have defined, eclipse just find adapter first)

So, if I want to run this project, I must copy all and paste to apache folder. Too handy !!!

Please help me.

Thanks :)


When you add the server, look in the "Basic" category for the "HTTP Server" - use that one there

| improve this answer | |

This answer is based on a Windows configuration, hopefully it works also in a MacOSX configuration.

  1. Say your AMP Server is installed in C:\AMP then your PHP files are in C:\AMP\www if you stick to using a standard configuration.

  2. In Eclipse you must have the PDT (PHP development tool) and SDK installed. If not get it using the Eclipse 'Install new software' feature. With PDT installed you can create a PHP project. Say you create a PHP project PHP001. By default Eclipse would store the sources for your project PHP001 in a subfolder of your Eclipse workpace, like ..\workspace\PHP001. This is where you need to change the location to C:\AMP\www.

  3. PHP001 shows in the Eclipse Projects view. You'll see it already shows the PHP files that you have in your wwww folder. To add a PHP file, right-click your PHP project, then New PHP file. To execute a PHP file, right-click it, Run as, then PHP Web application. Here again Eclipse will propose to start something like localhost/PHP001/your-php-file.php; you need to remove PHP001 level and submit localhost/your-php-file.php instead.

This situation might become messy if you create lot of test php files in your project, in which case you may want to develop your phps in an Eclipse folder and copy them to the www folder only when finished using Gilbert Le Blanc's method.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.