yashsingh1/xdaforums huggingface dataset:
[Android Software Development] dateno1:
i success run Serendipity :D

it work well :)

you must need to increase size of max request (or just using my config)

i think it better then pplog

you can download from here

* WYSIWYG and HTML editing

* Built-in, powerful media database

* Multiple authors, configurable permission/usergroup system

* Threaded comments, nested categories, post to multiple categories

* Multiple languages (internationalization)

* Online plugin and template repository for easy plug-and-play installation

* Cool plugins: category-based sub-blogs, podcasting, RSS planet/aggregator, static pages

* Robust spam blocking

* One-click upgrading from any version

* Can be embedded into your existing web pages

* Standards-compliant templating through Smarty, remote blogging via XML-RPC

* BSD-style licensing

* Multiple Database support (SQLite, PostgreSQL, MySQL, MySQLi)

* Shared installations can power multiple blogs from just one codebase

* Native import from earlier blog applications (WordPress, Textpattern, Moveable Type, bblog, ...)

it support multi language (and auto recognize user's browser's setting)

and you can use imageshark binary

you can see the screenshot from here (sorry for page is korean but i think you just need screenshots)
[Android Software Development] krzych:
I'm still overloaded and still did not tested anything. My broadband needed my attention (now it's 10 times faster than before :eek:), my salary got stuck somewhere in between :confused:, my software needs quick updates and many many more stuff just landed on my head :mad:. But I will became a tester! As soon as I gather time to set up all the first time. Updates should not be as time consuming.

You've meant partition mounted read-write? :)

(Trying to set it up, but test pages not today)

Result:

Redirection needed to silent those above ;). But server works. Stat page looks fine :). To be continued...

More:

And a piece of advice - make log and www dirs somewhere at /data mount - it is a subject of "constant" change in comparison to whole binaries. I did mine in /data/www and /data/www-logs (maybe it could be /data/var/www and /data/var/logs but I wasn't convinced I like it ;) ).

Going to test sqlite now...

Result: seems to work like a charm :D

So, you just "forced me" to take care of this shiny little DHD again in different way :D And I was just about to rest a while... lol ;)
[Android Software Development] viulian:
Hey, thank you for feedback :)

I guess those not redirect, I left them there in case people were complaining, at least to have an ideea what goes on. If you redirect them - excellent, once you know they work.

I tried to make a quick script to kill all children of php-cgi etc .. Probably not that good :) anything can be improved.

Thank you for the ideea with data .. I tried somehow to mimick Ubuntu's layout (but under /system) with var / usr / log etc - and since the scripts are small (so low footprint) I left it there.

Lately I've been focusing on .APK updates - did an APK installer for midnight commander (and is easy to make it install any other native app). If you have an idea on what else to compile let me know :)

I got shellinabox running on the phone, but unfortunately the only way to connect back to the phone is via openvpn between phone and a pc that has public ip. Openvpn is slow over 3G (at least in my case) and thus is not really usefull.
[Android Software Development] krzych:
No problem with the feedback - it is my duty if I want to use what you've managed to compile :D Thanks again, I barely manage to compile dalviks simple examples right now, this environment is still scary ;) (google should make SDK and NDK more user friendly or provide graphical env for ndk ... i don't know - it's just too hard for start even when I'm a linux developer ;P)

Hmm, I dunno what the shellinabox is, but sounds interesting. sshd should work about log in back to the phone in any case I think so if I could have what you are talking about I could see what can be done.

About the start/restart/stop scripts - I will do my versions too soon - now I'm just making some tests with php (mainly playing, amusing myself but it will test basic functionality and teach myself more about sqlite - I was using mostly postgres).

And yes, I can have many propositions for you to port to our DHD, but I would like to propose only what is necessary, no need to port unused stuff, so I should make a list which I will, but it will take time. Midnight Commander is a very good proposition. I've managed to install a version done by Paul (?) - Visionary+ author I think - which is done by opkg manager or something like this. It works, but it is a pain in the ass to configure everything right before it works. And as far as I am concerned, it's not newest one... or I'm wrong - no matter - APK would be great.

Maybe you should create a new thread with every app you port for DHD?

By the way - you seem to be very reasonable person which I like very much (;P) and I would like to help you in some efforts about which I have any knowledge (and I have some). If you want to make this faster, we should use some faster communication methods ;) (I'm here rarely, even e-mails are just queued lately ;) ). Maybe some communicator?

And I can host some files too. I mean mirror or ... I dunno, whatever ;).

PS.

This should do the trick for restart:

kill `ps | grep -e 'php\.ini' -e 'lighttpd\.conf' | awk '{print $1}' | xargs`

But if there is no process, will complain about nothing to kill in params

I attached simple

BASH

(!!!) script for start|stop|restart
[Android Software Development] krzych:
Erm, I think I've found something strange.

Try this:

<?php

echo "echo1";

system( "pwd" );

echo exec( "pwd" );

echo "echo2";

?>

There is no error, no result, nothing. Just nothing. Without commandline there would be quite a problem to make a maintenace page which I would like to do :).
[Android Software Development] viulian:
Sorry for not having too much time to reply, I will send a strace executable for you tonight to see what goes on.

Unfortunatelly, for me it works:

[root@arc]/system/var/www# php-cgi pwd.php
X-Powered-By: PHP/5.3.8
Content-type: text/html

echo1echo2[root@arc]/system/var/www#

(and also from the web).

I will send you a strace executable - as a thank you for your scripts :) I will try them tonight too.

1. The version of mc you mention (which was 4.6.2 - has some issues which I described here: http://xdaforums.com/showthread.php?t=1243699

2. Using NDK was a chore for me - I've tried some things but many libraries were missing (for mc for example) and I had to compile each one individually and so on. I then decided to switch to buildroot. Is not easy also and apps aren't actually ready to be cross-compiled, you still need to adjust scripts / code to get everything to run.

3. About mirroring, I can host them myself :) for now. I don't have any monetary gains from this development and one of the few joys is to see the number of downloads increasing. I hope you understand.

I guess in the near future we will need a unionfs for /system too :D (as app2sd does for /data) since with all the tools statically linked, the free space remaining is ...
[Android Software Development] krzych:
Read slower :) - your result is bad too (mine is the same). Between echo1 and echo2 there should be working path like this:

[root@arc]/system/var/www# php-cgi pwd.php
X-Powered-By: PHP/5.3.8
Content-type: text/html

echo1/system/var/www/system/var/wwwecho2[root@arc]/system/var/www#

(exactly twice coz system AND exec would echo it)

But it will be nice to have strace'd one too.

About mc - was it yours too? I'm amazed :D. Anyways, have you got the "armnux installer" sources? I would like to have such a thing to manage my iptables ;P :D (of course it would be better to have direct iptables lib access through NDK but I do not know that this won't kill me ;P)

About my script - it is important that it's bash language version - with sh addition not works using $[] and I didn't had time to search how sh does it.

And mirroring was just a proposition, it's good that you have possibilities to do it by yourself :).

PS. I have to read about unionfs - I see that I'm quite backwards... (underdeveloped? i don't know how to say it in english correctly)

PS2. vim - I don't know how big it would be, but it is worth trying I think.
[Android Software Development] dateno1:
hmm....viulian//can you add some command for restart phpd and httpd by self option?

if someone try to make installer apk but it need root for kill processor :( (it's so bad)

i think it almost perfect at now...(sqlite and php, perl, lua work well :D)

i already upload pureftpd for android(http://xdaforums.com/showthread.php?p=18137466#post18137466) (but i don't know how can setup it :() (i havn't sample setting file) (it have so many option)

i want to add smtp/pop3 and ircd for android but it not easy :(
[Android Software Development] dateno1:
i update my pack

add lighttpd script and remove reload script (now you can use lighttd start/stop/restart)

change the setting path to /system/etc from /system/etc/php, /system/etc/lighttpd

and add more parameter for fix some problem (and increase max size to 10Gb)

and some more change for work well (example : auto add&bind /var/tmp for large file upload (i don't know why need it :() )
[Android Software Development] viulian:
Ah :) I thought you said you did not get ANY output, and I was happy when I saw the echos.

During the day I've played with strace. PHP doesn't execute 'system' because what it does internally is executing /bin/sh -c 'pwd'. But /bin/sh is not there...

I don't know if this can be configured in php.ini, if not, I will probably have to recompile with the /system path harcoded ...

You can grab the strace executable I've built from here:

strace.zip

I did not try to trace Android native apps, just the apps that I've built myself (mc, php, lighttpd, etc...). For these it works. For others I don't know ...

I do have them since I wrote it :D They're not ready yet, I need to polish and add some more documentation and then I will put them to git hub / google svn. Will let you know.

I will make a similar installer for bash too (or add it in this one). Actually I named it Armnux installer (from ARM and Linux) as I thought it will be actually an installer with checkboxes for each native app that you wish to install (and the archives will be downloaded off Internet).

For now is just MC to test if it is working and so on.

For example, it detects alone the type of partition and the mount block and mounts it rewrite.

Vim will be included yes, I hate the message 'u is not implemented'.

User smitna also sent me some restart scripts too / I need to test.

I've tried compiling some IRC servers, but they all need modules that are loaded at runtime. Poor implementation using dlopen to load libraries on the fly (even if compiled statically). I had no motivation to recode it so that they are included at run time (lighttp has this code, and I would have had to duplicate the behavior, as lighttpd also loads using dlopen - but it has code that if compiled statically, it will actually link the modules in the executable). The IRC servers I've tried don't do it.
[Android Software Development] krzych:
It would be very very bad. You should use env variable inside the code (very simple in libc, I dunno what can be done for android version, but should be easy too) - it is really annoying when someone forces you to use sh/csh/ash when you love bash or vice versa.

I will insist on env var :) And I can help if I should :)

Thanks :D

Emm, can be done before you finish everything? :D I do not need an installer/manager - I need any ready-to-use-framework to mess with coz I have really little time lately and starting from scratch was not quite quick as far as I tried. I can handle working-copy, believe me ;)

Yep :D I do it few thousand times daily, dd, u... - ops, SHIFT-P - lol

Merge mine and those two ;).

About irc... what would be ircd needed on android for? Personally I dont see any reason. Even if it will work, traffic will kill the battery (not by throughput but by readiness), nobody will see such ircd coz no domain registered and dhcpd will kill users will to chat, and yes, similar could be reasoned for httpd, but all we know that httpd is for us a language/libraries provider, but ircd?

I see more sense for eggdrop than ircd ;P (but I need neither - I left irc many many years ago and do not want to come back ;) ).

PS. I have now more recent php on my android than on my personal server :D

PS2. Yep, symbolic link /bin/sh to /system/bin/sh helped with system and exec, but when linked against bash it doesn't simply work at all (I suspect different commandline parameters so feel free to hardcode /system/bin/sh into this php port, I'll use bash as a second layer if I wish to have flexibility)
[Android Software Development] dateno1:
oh i foget

add perl, lua and some option (readd them)

i success to connect from outdoor :D

but perl script work only on IE (not work on firefox3) (i don't know why)
[Android Software Development] krzych:
I'm not catching your language good enough (for example, I dunno why you attached something), but it seems you are wrong about perl. Perl is server side, so it cannot depend on browser. It's simply impossible.
[Android Software Development] dateno1:
i already know about that

but when i try access perl based page on firefox browser just try to download pl file but on the IE i can access to page

oh i don't know why but i fix it for edit conf file :) (just remove 1 line)
[Android Software Development] dateno1:
when i try to use server.network-backend="writev" i can't download big size (just 4975.15 kB) file (i success to download 3797.55 kB size file)

i disable this line and restart server work well

i think server recognize wrong size of file on server or transfered

when i check original source code i found about writev

if (transfered size > original size) then disconnect connection
[Android Software Development] viulian:
According to lighttpd blog here: http://blog.lighttpd.net/articles/2...ghty-for-high-concurrent-large-file-downloads , for this setting to work, the network_writev.c file needs to have LOCAL_BUFFERING defined.

I've checked the sources and noticed:

#if 0
#define LOCAL_BUFFERING 1
#endif

So don't use it :)

Unfortunatelly, I have no time these days to take care of these issues (PHP path to /bin/sh as environment variable, and this LOCAL_BUFFERING)... For sure after weekend.
[Android Software Development] dateno1:
i think you don't need to change /bin/sh to /system/bin/sh

just symlink /system/bin or xbin to /bin

some binary need /bin/something so i already symlink /system/xbin (my binarys and busybox here) to /bin
[Android Software Development] krzych:
No rush man :) You can even rest a month, you've already did a very good job so you earned our gratitude already ;)

Content-type. Firefox guesses, IE expects it.

He meant "in source path change", not on the filesystem.
[Android Software Development] dateno1:
oh

you must update php.ini

i forgot this phone (not server)

increase timeout and decrease max memory use per thread (12M * 4) (if you are more highend machine edit memory_limit value)
[Android Software Development] dateno1:
repack all update&@

repack all update

you just extract it

i notice vfat is faster then nilfs2,ext3,ext4 so i add some line

it will increase performance of scratch directory :D
[Android Software Development] viulian:
@dateno1 - does your repacking also bundles new binaries (with the /bin/sh bug discussed above) or just the .ini files which you attached before ?
[Android Software Development] krzych:
You cannot be more wrong. FAT is not faster. FAT is just simpler, but still ext's (both) can be faster than that. Obviously you have journalling on or other switches which made it slower, and by the way - your internal flash memory of the phone can be much slower than your SD card, it depends on the card you have.

Think before you type please.

PS. Considering you would have right about it, the /data partition should be FAT because it does not need to be ext-like, only /system has to be like this. Now, think why /data is still ext-one... Isn't it quite weird?
[Android Software Development] dateno1:
no just update script and configure files (but it will make your server more stable)

i can move or bind attache's folder but it will can make critical secure hole :( (it will make chroot not work)

fat is just simple so it fast write speed on my phone (it's good for scratch :D) (i don't want to bind it for secure reason but on my phone vfat is 3time faster then ext4 :()
[Android Software Development] krzych:
Try to make ext-like on your SD, you'll se what I've meant (but switch off journalling).
[Android Software Development] dateno1:
i already try ext2 but vfat is faster :(

---------- Post added at 11:34 PM ---------- Previous post was at 11:31 PM ----------

i also try to change php thread's child

try 2~6 thread (18requset and check 3times)

6:1:40/1:34/1:39 (1:37.7)

4:1:31/1:35/1:30 (1:32.0)

3:1:39/1:41/1:43 (1:41.0)

2:1:32/1:31/1:40 (1:34.3)

sorry i forgot to write 5 thread's time
[Android Software Development] dateno1:
i add auto restart service

if you want to use you will edit your ramdisk (init.rc)

add it

service scriptRunner /system/bin/scriptRunner

class pre-zygote_services

console

it will prevent lighttpd is terminated or can't connect to server

oh i forgot to add robots.txt :(
[Android Software Development] viulian:
It is good that you have all these updated scripts for people that are interested :)

I still have to fix some bugs in PHP (mostly related to system calls) as well as recompile with a true static version of OpenSSL (for lib-curl dependency).

However, I cannot tell when this will happen, hopefully this week ..
[Android Software Development] Proxin:
This is awesome, works really well and was exactly what I was looking for.

Thanks a bunch for sharing this. :)
[Android Software Development] krzych:
Crap. I was absent so long and will be some more. I hope it does not lower your eager to produce thing you did well till now :). It seems you are overloaded too (considering your homepage activity stopped), but I hope we all will be soon more flexible. In my case, I just don't know how soon ;-P
[Android Software Development] viulian:
I have fixed the system(...) bug.

Even if I found references to "/bin/sh" within PHP source code (proc_open.c), PHP in fact delegates to libc to actually do the calls for system / exec, by using libc builtin system(...) call.

Accoding to the C standard, libc's system method relies on /bin/sh to be there.

So everything was correct, but not working :) on Android.

I have rebuilt PHP and now it is working!

This script:

<?php

$out = array();
exec('/system/xbin/ls /system 2>&1', $out);
print_r($out);

$output = shell_exec('ls -l');
echo "<pre>$output</pre>";

?>

now produces these results:

[root@arc]/system/var/www# php ./exec.php
X-Powered-By: PHP/5.3.8
Content-type: text/html

Array
(
[0] => app
[1] => bin
[2] => build.prop
[3] => etc
[4] => fonts
[5] => framework
[6] => lib
[7] => libexec
[8] => lost+found
[9] => media
[10] => semc
[11] => share
[12] => usr
[13] => var
[14] => vendor
[15] => xbin
)
<pre>-rw-rw-rw- root root 145 2011-12-05 22:27 exec.php
-rw-r--r-- system system 21 2011-09-21 20:01 index.php

Please redownload from first post :)
[Android Software Development] krzych:
Wow, man, im stunned!

I previously stated in this post that it's impossible to libc use of sh, but IT IS!

I'm totally stunned! I never knew how BAD system call IS!

For "sleep 100" command it does exactly execve("/bin/sh", ["sh", "-c", "sleep 100"]

I hope I neve used this command in producton environment :D LOL
[Android Software Development] viulian:
Just to clarify :) this built of PHP is statically linked against uClibc and NOT against Android libc.

So the 'bug' is not really a big. uClibc following standards and relying on /bin/sh to be there. The faulty behavior is that on Android /bin/sh is not there.

However, programmers should invoke system with NULL argument just to check if /bin/sh is there - taken from http://www.delorie.com/djgpp/doc/libc/libc_802.html:
[Android Software Development] krzych:
Is it safe?

Broken link.

[Edit]

[deleted]

[edit]

I'm almost sure now that the problems are not connected to lighttpd. So forget about [deleted] part of post.
[Android Software Development] viulian:
I have successfully compiled php 5.4.1 with cURL as well as openssl.

[root@arc]/system/var/www# php -v
PHP 5.4.1 (cgi-fcgi) (built: Apr 28 2012 03:52:49)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

[root@arc]/system/var/www# php -m
[PHP Modules]
cgi-fcgi
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
openssl
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

I will release it in the next few days, for now I am tired. I think I will add a "Donate" button on the homepage :) so that somebody could hopefully compensate the frustration of fiddling with everything.

For now only the CGI version.
[Android Software Development] krzych:
Hi! Where were you? :D

I don't have time to play with my phone last days, but I surely will download this one for testing any time later :)
[Android Software Development] viulian:
I have uploaded version 5.4.2 - download link is on the first page!

Changelog beside php version upgrade:

a) curl module

b) openssl module

c) SQLite (new with php-5.4.2 apparently, beside the already included sqlite3 module)

This means that curl_setopt method is available with CURLOPT_SSL_VERIFYPEER or CURLOPT_SSL_VERIFYHOST flags.

Hope you guys will like it :)
[Android Software Development] viulian:
What other PHP modules you guys believe are useful ?
[Android Software Development] mateorod:
I was wondering if you guys have seen Botbrew? It has lightpad and imagemagick, along with curl, gcc, python, ruby, git, subversion...

It's pretty cool and is looking at some of the same things you are.

the dev is about to release Botbrew +1, with a debian chroot INSIDE android, giving you access to basically the whole debian library. From what I understand, there will have to be some custom runit scripts written on an as-needed basis for some of sections of the debian package library to be usable, but it is going to be done on a piecemeal basis until everything is available.

Here is the Botbrew thread

And here is the thread for Pengdroid, the debian distro that will be incorporated for the jump to Botbrew +1

I'm not trying to divert or show up the project, just show you a new resource. inportb, the dev behind it, really couldn't be nicer or more supportive of proects just like yours. I'm sure he'd be interested to see what you've come up with so far.
[Android Software Development] viulian:
Very nice job done by botbrew :) thank you for the tip!

It has gcc indeed, but apparently it doesn't have php nor mysql yet. I will investigate to see what the guy did - but it seems very structured and very nice!
[Android Software Development] krzych:
BotBrew guy is doing much worse job as you ask me. I would rather stay with you. Botbrew has just more crosscompiled tools (which is nice) but it is as good as it does not hang up because it's gui can do it. And the idea itself is flaky too because it's not adding anything into path so to use any of the tools it provides user has to make changes for himself which is not quite nice for every user.

But besides this, it's like you said, lighthttpd is a clean one, no php, no anything useful in it, just html.
[Epic 4G Q&A, Help & Troubleshooting] maxertx:
Ok this is weird, when I have my BT on I keep getting a pair request from iwonpaymybills. I'm not in discovery mode, I'm already paired with my headset or nuvi. Question is wtf and where would it be in the file system so I can kill the file?
[Epic 4G Q&A, Help & Troubleshooting] mrrick:
Are their businesses around where you are?

*insert sig here*