开发者

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:

  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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜