Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 :)

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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