Whats the best way to deploy a PHP (PDT) Eclipse Project to Apache? (on Ubuntu)
What's开发者_StackOverflow中文版 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.
I came across this page looking for a Windows solution and found this little workaround in the meantime that might prove useful to someone:
- Select Run > External tools > External tools configuration
- Add a new configuration, name it Deploy or something
- Set the location field to C:\Windows\System32\xcopy.exe
- Set the argument field to ${workspace_loc}${project_path}\*.php c:\inetpub\wwwroot\${project_name} /s /y
- 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.
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
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!
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.
http://andrei.gmxhome.de/filesync + http://code.google.com/p/win-sshfs/ is remarkably good.
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
精彩评论