Thursday, November 24, 2011

PHP Plug-in Update

My cross compiled version of the PHP CGI was not working so well and I didn't manage to fix it.

Fortunately Klaas Biker informed me that Iulian Virtejanu has cross compiled a PHP CGI version that seems to work significantly better.
Here is Iulian's blog entry: PHP and Lighttpd for Android

Iulian gave me the permission to use it in PAW, so I have updated the PHP Plug-in to version 0.3.

There is one known issue:

system(...) does not work.
It is because system('pwd') actually invokes a hardcoded /bin/sh -c 'pwd' - and /bin/sh is not available on Android.
Iulian has submitted a bug report to PHP: https://bugs.php.net/bug.php?id=60081

If you find more bugs, please let me know. I will forward them.

4 comments:

  1. When you are root, make
    (make / read-write)

    mkdir /bin
    ln -s /system/xbin/busybox /bin/sh

    (make / readonly)

    And then you have made /bin/sh as symlink.

    ReplyDelete
  2. Hi, I'm having a pretty severe issue with this...
    phpinfo() sometimes (approx 1/10) fails on a vanilla installation of this plugin.
    The behavior is that the HTTP response PAW returns 0 data, and the browser does not refresh.
    It is visible if you use:



    approx 1/10 times this script will not execute, you can tell because the microtime does not increase.

    The same behavior can be caused by generating a php parse error, eg:

    <?php
    echo microtime();
    echo 'hello wo

    I believe the reason for the phpinfo() fail is that paw is not reading the entirety of the php script, and sometimes only executes up till mid-line..

    I don't know whether this is a PAW issue or an issue with Lulian's binary, however I believe he has generated a binary of PHP 5.4 so perhaps you could ask him for permission to use it in a new update of PAW?

    This issue is causing my MVC to fail approx 19/20 times, so it is very serious for any larger-scale applications...


    Thanks!
    Dean.

    ReplyDelete
    Replies
    1. That first example did not display, presumably because I closed the <?php tag.

      It was supposed to read:

      <?php
      echo microtime();
      phpinfo()

      Delete
    2. Is this also happening with the 5.3.6 version of PHP?

      Delete

Note: Only a member of this blog may post a comment.