I had some trouble setting up Run Configurations in Eclipse for PHP (PDT plugin). Here is my note for future reference.
Machine: Ubuntu 15 64-bit, with Eclipse Mars. sudo apt-get install php5 installed apache2 for me, so no additional web server install is necessary.
1. Enable userdir mod:
sudo a2enmod userdir
2. Your /etc/apache2/mods-enabled/userdir.conf should look like this, if not, make it so:
<ifmodule mod_userdir.c> UserDir public_html UserDir disabled root <directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec <limit GET POST OPTIONS> Require all granted </limit> <limitexcept GET POST OPTIONS> Require all denied </limitexcept> </directory> </ifmodule>
3. Comment out the user directories section in /etc/apache2/mods-available/php5.conf, like so:
# Running PHP scripts in user directories is disabled by default # # To re-enable PHP in user directories comment the following lines # (from <ifmodule ...> to </ifmodule>.) Do NOT set it to On as it # prevents .htaccess files from disabling it. #<ifmodule mod_userdir.c> #<directory /home/*/public_html> #php_admin_flag engine Off #</directory> #</ifmodule>
4. Create a public_html directory under your home directory;
5. In Eclipse, create your PHP web application project under public_html in your home directory;
6. In Eclipse, while under PHP Perspective, click the drop down next to the green run button, and select “Run Configurations…”;
7. Create a new configuration for PHP Web Application. Pay attention to the following two things:
a. In the Server tab, Server section, the PHP Server should be “Default PHP Web Server”, this is fine.
b. Click the “Configure…” button, you’ll see this. Fill in proper “Document Root” value, in my case, /home/haidong/public_html
c. Click the Debugger tab, and pick “XDebug”
d. Go back to the original configuration screen, pick the proper file, and fill in th URL info, like below
By the way, Happy 2016 all!