Tuesday, March 20, 2012

PAW Runtime & PHP

PAW Runtime has been updated to support PHP.
To install PHP for the runtime version of PAW, download the file PawRuntime_PHP_Setup.zip (link below) and unzip it to /sdcard of your Android device.

After starting PAW Runtime a PHP menu entry should be available.
After selecting the entry the page shown below should appear...

PHP Setup
Make your selections and press the Install button. PHP should be available after a restart of PAW Runtime.

If you wold like to get rid of unnecessary files and the menu entry, you can delete the file /sdcard/paw-runtime/webconf/apps/php_setup.conf and everything inside the  /sdcard/paw-runtime/html/php_setup directory except the conf directory.

Links
PAW Runtime
PHP Setup

Update
If you have problems to download above files from the original source, try to use the alternative RapidShare links below:
http://rapidshare.com/files/1766553424/PawRuntime.apk
http://rapidshare.com/files/3080577482/PawRuntime_PHP_Setup.zip

82 comments:

  1. i have only thing to tell you...

    You are the BEST!

    The most fastest answer in the world!

    Thank you! When i finish my projects i will come back and tell you :)

    ReplyDelete
  2. what is the link to open in browser the server?

    ReplyDelete
    Replies
    1. There is no link. Just open the app.

      Delete
  3. Love your work!

    Can you provide the source code as you did with the original paw-runtime (http://fun2code-blog.blogspot.com.au/2010/09/paw-runtime.html)? or is the source available on github or similar?

    I am interested in contributing to this project.

    Thanks,
    Dean.

    ReplyDelete
    Replies
    1. I've updated the source also.
      Just use the link from the original post.

      Delete
  4. Sounds very interesting, but it doesn't work on my phone... just says 'available applications' with black screen, that's it.

    Can you please assist?

    Cheers - 0/1

    ReplyDelete
  5. Uuups ... sorry!
    There was an error in the index.xhtml file.
    So if only one application was installed nothing appeared on the first screen.

    This should be fixed, I've uploaded an update.
    Please download and install the new version and make sure to delete the /sdcard/paw-runtime folder prior to the first start of the app.

    ReplyDelete
  6. Hey Jochen,
    Is paw-server open source?
    It would be great to know how you got this all running on android...

    Thanks,
    Dean.

    ReplyDelete
    Replies
    1. PAW Server itself is not Open Source.
      But the PAW Runtime Eclipse project is available as download.
      With that it's possible to build your own server.

      You can find the download here:
      http://paw-android.fun2code.de/download/AndroidPawRuntime_Eclipse_Project.zip

      Delete
    2. With Paw-Runtime can you actually build a server to serve pages to other machines on the network though?

      Thanks,
      Dean.

      Delete
    3. If there is interest I can add some changes to PAW that would allow to build your own app with PAW backend.
      This might take a while, but I could do that.

      Delete
    4. That would be very helpful!
      I'm considering using paw-runtime to do a presentation at sydphp.org on how php developers can create apps for android using your program :)
      Thanks again for your work!

      Delete
  7. Hi, I'm doing my first experiments with PAW, I can access the server through my local network (WIFI) from a PC, however when I try this address in the same phone browser (locally) I can not access it, I can neither access the server using the loopback (127.0.0.1) or "localhost", can give me some tip about what I'm missing?. Thanks in advance.

    ReplyDelete
    Replies
    1. This normally should work.
      PAW binds to all interfaces. I've used it a couple of times without problems.
      What's your device?

      Delete
  8. That's odd, I'd opera mini installed, I uninstalled and with the default browser I ready can access PAW

    ReplyDelete
  9. I'm not able to run php interpreter. Could someone tell me how to make it working? It is possible to create an app or something similar with this server to make it download files from the Internet in background? I would like to use it as a download station.
    Excuse me for my bad English...

    ReplyDelete
    Replies
    1. PHP 5.3.8 does not seem to work with all devices, but 5.3.6 should.
      It is possible to run things in background. Depending on how and what you would like to do the normal PAW server might be a better choice.

      Delete
    2. Thank you very much but the problem is that I haven't been able to understand where I have to put php files of your package... Is there someting ready to force the device to download files? In fact I would like something like a box where I put a file url and the device download it for me.

      Delete
    3. You might want to try the normal PAW Server from the Play Store:
      https://play.google.com/store/apps/details?id=de.fun2code.android.pawserver

      There is also a PHP plugin available. After the plugin is installed, you can place your PHP files inside the /sdcard/paw/html directory.

      Delete
  10. I have installed this but I don't know how to apply the php plugin.

    ReplyDelete
    Replies
    1. You can find more about the plugin and its installation in the following post:
      http://fun2code-blog.blogspot.de/2011/04/paw-server-php.html

      Delete
  11. Can this become an android webserver for slidifier: (repository zip:)
    https://github.com/Espenhh/Slidifier ?

    I can run the slidifier repository in winXP with the portable app "USB webserver":
    http://www.portablefreeware.com/?id=1185 . So I was wondering.
    Many thanks for your great work.

    ReplyDelete
    Replies
    1. I don't know Slidifier.
      This might work or not work, I can't tell.
      Give it a try.

      Delete
    2. Thanks for your quick reply. The short question is hopefully you would give me a link (if there is one / a few) to using "sqlite" on PAW which the above depended. I browsed briefly here and it seemed to escape me (my bad).

      Delete
    3. I have no experience with PHP and SQLite.
      What I know is that phpLiteAdmin is working.

      Delete
    4. sqlite works no problems...
      just do something like:

      $dbh = new PDO('sqlite:/sdcard/my_database.sqlite');
      $dbh->exec($query);

      Delete
    5. Hello Jochen. You pointed to the right direction and for the benefit of others I would humbly say that (on a preliminary basis) I succeeded by following this in the phpliteadmin site: just first 5 paragraphs above Gscript-Lite (so device-rooting is NOT needed):
      http://code.google.com/p/phpliteadmin/issues/detail?id=66 . Greeting and a big thank-you.

      Delete
    6. Hello Dean. Our replies practically crossed each other in cyberspace (didn't see your guide while I was typing my reply). GreetingS and thank you too.

      Delete
  12. Hi,
    Can you help me?
    i want use a sqlite database on PAW Server (sqlite2 and not sqlite3).
    and use the sqlite_open() function, but i have a
    Disk i/o error.
    sqlite3 seems to work, but i need sqlite2.
    How its possible to use a sqlite2 database ?
    Thanks

    ReplyDelete
  13. Force Close on Xperia Play

    ReplyDelete
    Replies
    1. Hi,
      what version of Android does your device run?
      Could you please send me the logcat output (jochen[at]fun2code.de).
      Thanks...

      Delete
  14. I'm using the PAW from Google store and want to use the runtime and PHP now.
    But the download links are redirected to other site.
    Can you please check the download links?
    Thanks.

    ReplyDelete
    Replies
    1. The download links are correct. I don't know why some browsers seem to have problems.
      Try wget instead, this should work.

      Delete
  15. Could download with Downthemall in FF.
    Not sure why either, but if I just put http://paw-android.fun2code.de in FF (WinXP)it goes to Google.

    Thanks.

    ReplyDelete
  16. This doesn't seem to work for me. I have tried installing the "Paw Server" which it had no issues installing, but when I go to access the http://IP:8080/app/ folder, I am asked for a password, I type in the admin/paw and it asks for the password again.. I have tried this on android "My Browser" and "Browser" (guessing IE and Chrome versions?)

    I am running Android 2.2 on a WM8650 WonderMedia netbook..

    I have also tried the instructions on this page (uninstalled the Paw Server) and ran the Paw Runtime, and though the app installs, it gives an error on opening of the Paw Runtime. The error says, "The application Paw Runtime (process de.fun2code.android.pawruntime) has stopped unexpectedly. Please try again.

    I am debating just moving to HTML 5 only for what I need, and using local databases.. though I would love to have php available... :(

    ReplyDelete
    Replies
    1. Normally the user/password should work. You can try to disable it by renaming the file /sdcard/paw/paw/html/app/auth.bsh.
      For the FC when starting the runtime, you can send me your logcat output to:
      jochen [at] fun2code.de

      Delete
    2. Hmm, There is no auth.bsh file in that folder... Maybe I am missing something? I have downloaded the file from, http://fun2code.de/download.html, the "Download SdCard Content" link. I have double checked, and do not see that this file is provided with the zip?

      Delete
    3. Make sure to install PAW from the Play Store. Sounds like you are using an old version.

      Delete
    4. My tablet has only front camera no back camera.It error when call function web cam like this.Is it cause?

      Delete
    5. I don't have such a device, so I can't test.
      You could try the following methods of CameraPreview:
      setCameraId(id)
      boolean isCameraIdSupported()
      int getBackCameraId()
      int getFrontCameraId()

      Try to set the camera id to the front facing camera.

      Delete
  17. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. OK. Thx. I try on my T Mobile G1.:)

      Delete
    2. Works finally be the php module. The installation went smoothly paw reach of the Internet posed no problem. The PHP installation is not something went smooth, but finally succeeded. I know it's not a small effort to pack the server, and therefore I can not really criticize. : xD The thing is that I've tried a couple of mobile phones, servers, and the paw well, not one of the fastest. Then kise Elvan komplikalva the server. Many features are not interesting, it is not safe, that are disclosed to the public, at par with the functionality that did not work on my phone, and therefore the complicated signaling. Good luck continues. :)
      http://csa.gowisoft-hosting.tk/gallery/index.php?display=2012%2FMobil%2Fpaw.JPG

      Delete
  18. Why Php is not supported in SGY. I tried it many times. I want Paw Integrated with php mysql.

    ReplyDelete
    Replies
    1. Did you try PHP 5.3.6?
      mySQL is not supported but SQLite will work.

      Delete
  19. Is it possible to run my PHP script from external SD, and not the paw/html folder? I saw somewhere on this blog that this is possible with the piratebox plugin, so I wonder whether this can work the same way with the PHP plugin also! Possible? Or am I asking too much?

    ReplyDelete
    Replies
    1. You can change the directory inside the file /paw-runtime/conf/handler.xml.
      There is a section called "PHP CGI Handler" which also includes the directory definition.
      Change the value of the parameter "phpCgiHandler.root";

      Hope that's working...

      Delete
  20. hi!
    the first step was successful .. i can see the plugin on the list.
    when i try to install it is popup a login screen , so i try to login with user:admin pass:paw ... is no way :the popup window to login again and again is reapearing over and over again..
    i use android in virtualbox , the paw server works well, i can see in maxtor browser the settings page of paw : http://10.0.2.15:8080
    i tryed to set another pass on settings..that works but not fix the problem installation.
    i think is not root but with my poor knowings about android i can't fix it myself...
    thanks for your try to do what i was lookin for: server + php + mysql on android.
    i will look closely if i have any others possibilities
    thanks

    ReplyDelete
  21. I have a rooted Samsung Galaxy S2 running the CM9 rom. I installed PAW web server from Google play, then uploaded the unzipped PHP plugin using sshDroid to the /mnt/sdcard/paw/html/app/plugin folder. After rebooting my phone, I placed a PHP file in the /mnt/sdcard/paw/html/ path, but the error message I got was "No input file specified". What am I doing wrong?

    ReplyDelete
    Replies
    1. Try to use PHP 5.3.6. With later versions, there seem to be problems on some devices.
      Hope that helps...

      Delete
  22. Hello,

    I've installed Paw server and I try to install the php paw runtime. I've the installation page for both 5.3.8 and 5.3.6 and the select TimeZone box, but no country to choose... :(

    I've restart the Paw serveur but nothing happend... no country to choose and than no way to install !

    Could you help me ?

    Thanks a lot !

    ReplyDelete
    Replies
    1. Does this error occur in PAW Server or the PAW Runtime?
      If it occurs in PAW Server an error message should be visible within the HTML source.
      So you can send me the iframe HTML soure and I will have a look.
      Email is: jochen[at]fun2code.de

      Delete
    2. Heylo,
      when I run 192.168.1.18:8080 I reach the pawserver homepage. Then I click on PHP Setup/PHP Setup for Paw Runtime.
      I reach the 192.168.1.18:8080/php_setup/index.xhtml page with a form. In this form, I've on options for the select TimeZone...
      I haven't yet open the source code from those files. I'll do it now.

      Delete
    3. Try to open in a different browser. Even I faced the same issue, but turned out it was my browser's problem.

      Delete
  23. The script "source(pluginPath + "/bsh/php_timezones.bsh")" doesn't works and doesn't give the array courntries to the select.

    ReplyDelete
    Replies
    1. Maybe the pluginPath is not detected correctly. It might be better to communicate via mail instead of commenting the blog. Just send me a mail and we will try to figure this out.

      Delete
  24. it works! it was my browser's problem!!!! Thanks for making this app!!!!

    ReplyDelete
  25. has anyone gotten exec() or system() functions to work? I'm trying to execute android shell commands.

    When I put these functions in a webpage and run it nothing happens.

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Your webpage at fun2code.de is down... any other links to download runtime/php-plugin ?

    ReplyDelete
    Replies
    1. Thanks for the info ... I'll check with my ISP.

      Delete
    2. I've added RapidShare links to the post.

      Delete
  28. This comment has been removed by the author.

    ReplyDelete
  29. I'm interested in your post(paw server).Possibly, How can I run (paw server) in the background on my App?

    ReplyDelete
    Replies
    1. Yes, i would love to know if is there any way to run it as a background application on our apps, thats would be awesome

      Delete
    2. Yes, this is possible.
      Have a look at the PAW Runtime source code:
      http://paw-android.fun2code.de/download/AndroidPawRuntime_Eclipse_Project.zip

      This is free for private and educational use.

      Delete
  30. Thank you for providing good app PAW server.
    I use PHP plugin with PAW server.
    -PAW server : version 0.89.
    -PHP Plugin : version 0.6.
    -Android : 4.2.2 (NEXUS7)

    I can't have access with following code.
    In case of using directive IP, I can access.
    >NG!!
    // $URL = "http://74.125.235.120/"; >> OK!!

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $URL);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    $output = curl_exec($ch);
    curl_close($ch);
    print $output;
    ?>
    I guess the name resolve program is not working correctly.

    ReplyDelete
  31. Sorry but my comment is garbled when I copy and paste.
    ...
    $URL = "http://www.google.co.jp/"; >>NG!!
    $URL = "http://74.125.235.120/"; >> OK!!
    $ch = curl_init();
    ...

    ReplyDelete
    Replies
    1. Seems like a problem with the name resolution.
      I myself use PHP very rarely. The PHP binary is taken from the site below. Maybe you get more information there.
      http://hex.ro/wp/blog/php-and-lighttpd-for-android/

      Delete
    2. Thank you for your information.
      It seems that they don't solve dns problem.
      According to their blog, the PHP is compiled based on glibc library, but Android is based on Bionic library. They need to refer to Bionic library to solve this problem.

      Delete
    3. There is actually a Bionic version.
      The plugin contains a list of PHP versions. The oldest version I built myself and is compiled against Bionic. But this has other problems.

      Delete
    4. This comment has been removed by the author.

      Delete
    5. Well, I got it.
      So they also had a reason not to refer to its library.

      If I find a solution, I try and report it.

      PS. I also try "gethostbynamel" but the result is the same. Maybe it is the same problem.

      Thank you.

      Delete
  32. Thanks good reply.
    so, I'm trying to run the PAW Runtime source(Eclipse project) on ICS(4.0.4).
    but, Force closed ..

    The logcat is below.

    W/dalvikvm(23972): Unable to resolve superclass of Lde/fun2code/android/pawruntime/PawRuntimeActivity; (66)
    W/dalvikvm(23972): Link of class 'Lde/fun2code/android/pawruntime/PawRuntimeActivity;' failed
    W/dalvikvm(24261): Unable to resolve superclass of Lde/fun2code/android/pawruntime/PawRuntimeActivity; (66)
    W/dalvikvm(24261): Link of class 'Lde/fun2code/android/pawruntime/PawRuntimeActivity;' failed
    W/dalvikvm(24261): threadid=1: thread exiting with uncaught exception (group=0x40d051f8)
    E/AndroidRuntime(24261): FATAL EXCEPTION: main
    E/AndroidRuntime(24261): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.fun2code.android.pawruntime/de.fun2code.android.pawruntime.PawRuntimeActivity}: java.lang.ClassNotFoundException: de.fun2code.android.pawruntime.PawRuntimeActivity

    ...

    E/AndroidRuntime(24261): Caused by: java.lang.ClassNotFoundException: de.fun2code.android.pawruntime.PawRuntimeActivity

    ReplyDelete
    Replies
    1. Make sure hat the PAW Server JAR file is Exporte inside the project's Java build path properties.

      Delete
  33. good day mate..I've just installed paw runtime php and it works well on my ics^^……i just want to know mate..if I want to install some cms(drupal.wp) on sdcard/paw-runtime/html for we developing.
    from the 127.0.0.1;8080 where should I pointed to ths cms folder??
    coz everytime I pointed to my project..it always redirecting to somewhere else..
    for an example
    I've put my codeigniter on /sdcard/paw-runtime/html
    and I should be accesing from browser in 127.0.0.1:1024/codeigniter..but it always redirect to 127.0.0.1:1024/php_setup/phpinfo.php
    and it seems the html folder won't display it content folder in the browser..
    so if you can help me out.I'll be very gratefull..thx^_
    sorry for my bad english^^

    ReplyDelete
    Replies
    1. Could you please send me a mail and describe your use case in more detail. My email is: jochen [at] fun2code.de

      Delete