7

What's the best way to deploy a PHP PDT Eclipse Project on Apache 2.2 on Ubuntu?

I already tried to find an Apache Eclipse server adapter but got no luck. Do you know any?

If not, what's the best way to deploy a PHP Project to Apache? Shell script? Ant script? Other solution?

I could put the project folder inside the Apache's www folder but I would prefer to have the project files on a cloned git repository outside of Apache.

I'm using Eclipse Helios SR1, PDT 2.2.1 and Apache 2.2.16.

Thanks in advance.

4
  • ircmaxell, the original post states usage of Git. Commented Nov 4, 2010 at 15:01
  • Ahh, I missed that... Thanks @Emil... Commented Nov 4, 2010 at 15:02
  • It's stil a very small dev team, 2 people. I was thinking more about a simple way to copy/deploy the project files (even from dev branch) to a local Apache server for the sake of quick test and debug. When (and if) the team grows we will consider a more robust deployment workflow. Commented Nov 4, 2010 at 15:43
  • Pedro, on a very small project I worked on they setup the dev box as the SVN server of record. Development was local (user's machine) then checkin to the branch on dev. It was tested in the branch, merged locally to trunk (also stored on dev) then from the staging and production machines, the code was simply checked out to go live (SVN CO) It may not be 100% correct, but for the small team it worked great. And NO scp or ftp connections required, ever. You may not be an SVN fan, but the plugin for Eclipse is SO easy to use...just right mouse click and go. Commented Nov 4, 2010 at 17:51

6 Answers 6

4

I came across this page looking for a Windows solution and found this little workaround in the meantime that might prove useful to someone:

  1. Select Run > External tools > External tools configuration
  2. Add a new configuration, name it Deploy or something
  3. Set the location field to C:\Windows\System32\xcopy.exe
  4. Set the argument field to ${workspace_loc}${project_path}\*.php c:\inetpub\wwwroot\${project_name} /s /y
  5. Create the directory c:\inetpub\wwwroot\${project_name} manually so xcopy doesn't get confused

This will copy all your PHP files over to your webserver content directory in a subfolder with the same name as your project. The nice part is that you can run this deployment shortcut from the Run Tool button, right next to your Debug and Run buttons.

Sign up to request clarification or add additional context in comments.

Comments

3

symbolic links!

ln -s /home/pedrosanta/Workspace/myapplication /var/www/myapplication/htdocs

setup your apache virtual hosts accordingly.

Or you could just set your virtual host's document root to your remote location.

DocumentRoot /home/pedrosanta/Workspace/myapplication

2 Comments

ouch, lolz. No, but seriously don't use your development checkout for a production release! Instead check it out somewhere else. get clone followed by a rm -r .git then do one of the above on the new production directory.
also if you still want the ability to do updated on the repo. don't do the rm but instead block access to the .git in apache config.
2

I found this question here on SO with a lot of useful answers: Does anybody have a development/staging/deploying workflow with php/mysql?

I hope it helps!

Comments

1

Save to local, SVN (or other version control via Eclipse) to branch, branch to trunk, trunk to test, test to live. I can't say enough about how important version control and testing is in any sized environment.....even if it IS a colossal pain.

Comments

0

http://andrei.gmxhome.de/filesync + http://code.google.com/p/win-sshfs/ is remarkably good.

Comments

0

I use Apache with eclipe by configuring Apache path to the workspace folder,

in httpd.conf (d:/workspace/php/ is my project location)

Alias /php/ d:/workspace/php/

Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all

restart Apache and

http://localhost/php/somefolder/somefile.php

Cheers

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.