It is also possible to use the embedded Jetty server.

Here's how I do it:

1) install "Eclipse for PHP Developers" from http://www.eclipse.org/downloads/

2) install "Google Plugin for Eclipse" adding to eclipse the update
site http://dl.google.com/eclipse/plugin/3.5

3) create a "New Web Application Project"

4) edit war/WEB-INF/web.xml of newly created project and add the
following snippet (let's hope to get nice formatting... :-).
IMPORTANT NOTE: this is assuming you have php5-cgi executable
installed (in Ubuntu install php5-cgi package). Change it to suite
your setup.

<code>
<pre>

  <servlet>
    <servlet-name>PHP Servlet</servlet-name>
    <servlet-class>org.mortbay.servlet.CGI</servlet-class>
    <init-param>
      <param-name>commandPrefix</param-name>
      <param-value>php5-cgi</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>PHP Servlet</servlet-name>
    <url-pattern>*.php</url-pattern>
  </servlet-mapping>

</pre>
</code>


5) create a new PHP file in project's war folder (e.g. phpinfo.php)

6) run the project as "Web Application"

7) browse to http://127.0.0.1:8888/phpinfo.php

bye,
  Marcello Nuccio

On 6 Mar, 19:29, mibtar <bim.pangili...@gmail.com> wrote:
> maybe you should just use firefox?
>
> are you using eclipse or netbeans?
>
> gwtphpin eclipse:
>
> suppose your apache's webroot is "c:\www"
> and you created your project in "c:\www\apps\"
> and your project name is "mytest"
>
> so your project is gonna have these directories:
> c:\www\apps\mytest\src
> c:\www\apps\mytest\test
> c:\www\apps\mytest\war
>
> you place yourphpfiles in the war folder
>
> test.php:
>
> <?php
>    echo "hello";
> ?>
>
> and in your java code, let's say you have this method to test:
>
> public void testphp(){
>         try
>     {
>         RequestBuilder builder = new
> RequestBuilder(RequestBuilder.POST, GWT.getHostPageBaseURL()
> +"test.php");
>         builder.setHeader("Content-Type", "application/x-www-form-
> urlencoded");
>         builder.sendRequest("", new RequestCallback()
>         {
>             @Override
>             public void onError(Request request, Throwable ex)
>             {
>                 Window.alert(ex.toString());
>             }
>
>             @Override
>             public void onResponseReceived(Request request, Response
> response)
>             {
>                 Window.alert("PHPoutput: " +
> response.getText());
>             }
>         });
>     }
>     catch (RequestException e)
>     {
>         Window.alert(e.toString());
>     }
>
> }
>
> in the project explorer of eclipse, right click your project and
> choose properties.
> click Run/Debug Settings.
> choose your project and click edit.
> remove the check in run built-in server and change the port to 80.
>
> run the project. copy the link in the "development mode" window and
> paste it in the browser's address bar.
> when you open the link, it will display a page not found error.
> because you really don't have a mytest.html in
> the root of your www folder.
>
> the link looks like 
> this:http://127.0.0.1/mytest.html?gwt.codesvr=127.0.0.1:9997
>
> copy "?gwt.codesvr=127.0.0.1:9997" from the link
>
> mytest.html is really in:http://localhost/apps/mytest/war/mytest.html
>
> paste the end of the previous link to the new link so it looks like
> this:http://localhost/apps/mytest/war/mytest.html?gwt.codesvr=127.0.0.1:9997
>
> now you can simply refresh the page to view any changes made to your
> java andphpcode.
> no need to compile or run.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to