Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
viulian
Old
(Last edited by viulian; 7th May 2012 at 10:36 PM.)
#1  
Recognized Developer - OP
Thanks Meter 345
Posts: 374
Join Date: Apr 2011

 
DONATE TO ME
Default [APP] php 5.4.2 + lighttpd 1.4.29 in FCGI mode, crosscompiled for ARM

Update 7 May 2012: New version released, containing PHP 5.4.2 with curl / openssl modules built in (still for armv5). Besides the version number, installation steps remain the same.

Introduction

The web page of the project, containing more information, licenses, configuration fils, list of modules for php and lighttpd, etc is here:
http://hex.ro/wp/blog/php-and-lighttpd-for-android/

It also contains and example, how to install SMF forum onto the phone

Download

This comes with NO WARRANTY. Use it at your own risk!

php-5.4.2_lighttpd_1.4.29_armv5.tar.gz

php-5.3.8_lighttpd_1.4.29_armv5.tar.gz

Installing

After you copy the archive above into the root of your SD Card, installation is easy:

Code:
cd /
tar xf /sdcard/php-5.3.8_lighttpd_1.4.29_armv5.tar.gz
reload-fcgi.sh
reload-lighttpd.sh
Make sure you are on the root file system (/) before executing tar command.

Also, mandatory: rooted phone + busybox + /system partition mounted read only.

Below information is older - which was before the bundle was ready

Coming soon:

(excerpt from phpinfo() now running on my phone)

PHP Code:
System         Linux localhost 2.6.32.9-perf #1 PREEMPT Fri Jul 8 13:45:08 2011 armv7l
Build Date     Aug 30 2011 22:07:32
...
PHP Version                        5.3.8 
...
Server API                            CGI/FastCGI
Virtual Directory Support            disabled
Configuration File 
(php.iniPath    /system/etc/php
Loaded Configuration File            
/system/etc/php/php.ini 
...
_SERVER["_"]    /system/bin/php
_SERVER
["FCGI_ROLE"]    RESPONDER
_SERVER
["SERVER_SOFTWARE"]    lighttpd/1.4.29
_SERVER
["SERVER_NAME"]    192.168.1.3
_SERVER
["GATEWAY_INTERFACE"]    CGI/1.1 
I have managed to compile lighttp 1.4.29 with fcgi support as well as php 5.3.8 (both latest version).

All graphics libraries are in as well as SQLite.
I will still have to play with OpenSSL to get it running. Maybe MySQL in the future

It will take a while to set everything up (a web page for source code, wiki on how to install), but we're close to have a fuller Linux experience on Android powered phones.
The Following 7 Users Say Thank You to viulian For This Useful Post: [ Click to Expand ]
 
edude03
Old
#2  
Member
Thanks Meter 10
Posts: 86
Join Date: Aug 2007
This would be amazing, I've been hoping for something like this.
[Previous Phones:] w810i, HTC Blue Angel, iPhone 2G HTC G1 (TMob), BB8900, BB 9000, iPhone 3G BB 8900, BB 9000, iPhone 3G, E71, iPhone 3GS, BB9700, HTC G1 (Rogers), Xperia X10, BB8320, i9000M, Palm Pre 2, Xperia Play (R800i), Motorola Atrix, BB Torch, HTC Desire S, HTC Sensation (TMOB), HTC Inspire 4G
[Current Phones:]
[Phone:] Galaxy Nexus [Kernel:] Franco.Kernel Nightlies [ROM:] Stock 4.1.1 [Radio:] I9250XXLF1 [Provider:] WIND
 
Adolf1994
Old
#3  
Adolf1994's Avatar
Senior Member
Thanks Meter 66
Posts: 382
Join Date: Jun 2010
Location: Fertőrákos
wow, I'm really looking forward this
It's cool to have this functionality, cuz sharing files via BT is a pain the ass
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier


I just like the show

Am I the only one here with animated avatar?
 
krzych
Old
#4  
Senior Member
Thanks Meter 259
Posts: 982
Join Date: Jul 2009
Location: Warsaw
I'm waiting too. And wish you luck. Thanks for the efforts.
HTC Desire HD
ROM history: Stock, LeeDroid, CM7, Virtuous Affinity, Ice Cold SandwiTch, Blackout ICS Incredible, ViperDHD - because it makes Sense
Radio S-OFF, SuperCID or here | Eng S-OFF or here | Radio flashing | Radios | Proximity | Launcher | Voice | Battery | Prop | GPS Antenna | Desire Boost - Audio Effects App for DHD
Android - the most buggy system I've ever seen...
 
viulian
Old
#5  
Recognized Developer - OP
Thanks Meter 345
Posts: 374
Join Date: Apr 2011

 
DONATE TO ME
Thank you for the kind words

Yes, everything works now, and I've tried out a PHP gallery as well as PHP file editor (so you can edit .php files within Opera connected to local host).

It works. Unfortunately, on my Arc, it takes about 3 seconds to generate a thumbnail of a camera image. Now I understand why the whole thing with Media Server indexing files first time after reboot, when phone is slow and etc .. and why the need that apps have to notify Media Server to index additional files when apps create them. So by the time user gets to open the gallery, their thumbnails are already there (it masks the delay).

I want to try out more scripts and then create an installer for the whole thing. If members here report it works, then I will upload it to the market.
 
Adolf1994
Old
(Last edited by Adolf1994; 6th September 2011 at 09:06 PM.)
#6  
Adolf1994's Avatar
Senior Member
Thanks Meter 66
Posts: 382
Join Date: Jun 2010
Location: Fertőrákos
I think I will try a bunch of forum engines.
How many additional modules will there be? ImageMagik is really useful… or at least GD

EDIT: ohh, didn't see OP says all graphic libraries included (^_^; )
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier


I just like the show

Am I the only one here with animated avatar?
 
krzych
Old
(Last edited by krzych; 7th September 2011 at 11:16 AM.)
#7  
Senior Member
Thanks Meter 259
Posts: 982
Join Date: Jul 2009
Location: Warsaw
Quote:
Originally Posted by viulian View Post
Thank you for the kind words
We should thank you for your efforts. And we are.

Quote:
Originally Posted by viulian View Post
I want to try out more scripts and then create an installer for the whole thing. If members here report it works, then I will upload it to the market.
You can count on me. I'm not a full time PHP developer, but I wrote few little "systems" in "my way" so it should test non-standard approach at least. but I believe you've already tested basic PHP behaviour

By the way - you mentioned something about mysql... I would personally prefer PostgreSQL, but I do not know anything about a way it's written so theoretically it can be harder to move to arm platform. Postgres is more flexible in many ways, and sometimes (I've heard) a way faster because of simplicity of mysql.

But if anything will be problematic with sql, I can always fall back to sqlite
HTC Desire HD
ROM history: Stock, LeeDroid, CM7, Virtuous Affinity, Ice Cold SandwiTch, Blackout ICS Incredible, ViperDHD - because it makes Sense
Radio S-OFF, SuperCID or here | Eng S-OFF or here | Radio flashing | Radios | Proximity | Launcher | Voice | Battery | Prop | GPS Antenna | Desire Boost - Audio Effects App for DHD
Android - the most buggy system I've ever seen...
 
viulian
Old
#8  
Recognized Developer - OP
Thanks Meter 345
Posts: 374
Join Date: Apr 2011

 
DONATE TO ME
Update:

libcurl won't be bundled (PHP will be compiled without --with-curl argument).

It seems that libcurl has a dependency on libc - and it tries to load libc.so causing php executable to crash.

Output from strace:

Code:
open("/system/lib/libc.so", O_RDONLY)   = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=273912, ...}) = 0
close(3)                                = 0
--- {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xfde0004} (Segmentation fault) ---
+++ killed by SIGSEGV +++
Segmentation fault
 
Adolf1994
Old
#9  
Adolf1994's Avatar
Senior Member
Thanks Meter 66
Posts: 382
Join Date: Jun 2010
Location: Fertőrákos
that's really sad. cURL is sooo cool. (´Д`)
but so far you always found a way to make things work and I hope the same will apply to this as well.
If you have an idea that would work, then will this released later? or you let us play with the cURL-less boundle?
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier


I just like the show

Am I the only one here with animated avatar?
 
krzych
Old
#10  
Senior Member
Thanks Meter 259
Posts: 982
Join Date: Jul 2009
Location: Warsaw
I won't mind lacking of cURL. We have wget onboard for simple downloads. For more sophisticated actions android isn't the best platform
HTC Desire HD
ROM history: Stock, LeeDroid, CM7, Virtuous Affinity, Ice Cold SandwiTch, Blackout ICS Incredible, ViperDHD - because it makes Sense
Radio S-OFF, SuperCID or here | Eng S-OFF or here | Radio flashing | Radios | Proximity | Launcher | Voice | Battery | Prop | GPS Antenna | Desire Boost - Audio Effects App for DHD
Android - the most buggy system I've ever seen...

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...