PHP : Impossible to exec() under Android -




i'm willing develop small webapp on android (rooted, 4.2.2) smartphone. app designed in php run on local network. so, installed kickweb server app on phone play store. php works yet i'm unable use of functions related exec (system, passthru, shell_exec).

apparently, reccurent problem when programming on android platform due unusual location of shell. (/system/bin/sh instead of traditionnal /bin/sh).

someone had same problem here checked php.ini : safe mode off , there no deactivated functions. tried suggested workaround symlinking /system/bin/sh /bin/sh , trying fix ownership/permissions, still got nothing... here's php test file :

  <?php echo "hello world";   $out = system('date');   echo $out; ?> 

it results in hello world , nothing else, no error. i'm sure must have missed somthing yet can't figure out what. i'm not familiar developping under android. hope guys have clue, thanks.

edit : after rebooting phone, noticed /bin folder , /bin/sh symlink had been removed... don't understand. here steps followed create them :

mount -o rw,remount,rw / mkdir /bin ln -s /system/bin/sh /bin/sh chmod 777 /bin/sh chown shell /bin/sh 

i tried copying whole /system/bin directory /bin, doesn't work better.

maybe should've posted in android enthusiast community. i'm not quite sure though, sorry mess.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -