PHP on OpenMoko
Last week at FrOSCon I received my new Linux computer with GSM chip, the Neo Freerunner . The device comes with all kinds of goodies, such as GSM, GPS, Wifi, Bluetooth, motion sensors and a micro SD slot. The hardware works just fine, but there are some software issues that make the phone not yet usable for my daily use. Improvements for that are on the way though.
You might be wondering, why the <beep> is this on Planet-PHP as well. As I mentioned, the Freerunner is basically a Linux computer - which means total freedom of what you install on it. Traditionally it comes with perl and python, including GTK bindings. However, no PHP is found on it. I set out to change that. Unfortunately there were some issues with cross compiling, so I decided to compile PHP * on* the phone. There were some issues with this.
The default distribution comes with BusyBox, which implements many standard Unix commands in one binary - but it doesn't provide the full version. This makes PHP's configure not work. In order to fix this, you can install the "coreutils" package, but that was broken at this time so I had to cross compile coreutils myself (note that you need to have the OpenMoko toolchain installed):
wget http://ftp.gnu.org/gnu/coreutils/coreutils-6.12.tar.gz tar -xvzf coreutils*tar.gz cd core* . /usr/local/openmoko/arm/environment-setup ./configure --host=arm-angstrom-linux-gnueabi make
From the finished compile, I copied head, expr, env and cut to the /usr/bin directory on the OpenMoko. With this done, I could compile PHP and install it to make the headers available for PHP's shared extensions.
After the PHP compile was done, I set out to continue with php-gtk . For this I had to install a few more packages: libglade-dev, libglib-dev and m4. Of both compiles I made packages that you can just install on the OpenMoko: php and php-gtk . In order to demonstrate that it actually works, I've also a demo application "CountDown" available as package .
Comments
fantastic Derick! i think php is an interesting language for phone apps too, there's lot of people who knows it and it can translate in a big amount of apps for the free linux on mobile hardware. thanks for sharing this!
Interesting approach to port software on the freerunner itself. How much diskspace do you need for the coreutils and PHP itself? And more interestingly, how long did it take you to compile PHP on the freerunner?
The four binaries from coreutils are just 230kb unstripped, but the big disk space user is the compiler, gcc. The GCC package is about 250Kb and you might need to install additional dependencies too. Compiling PHP took about an hour I think. I'd have cross compiled it - but there were some issues with libtool when cross compiling php-gtk.
Hi Derick.
I really appreciate your work with PHP and PHP-GTK on the OpenMoko - it saved me the work of learning Python in order to write apps for my phone :-)
I already wrote a Wifi-app and some more based on your packages.
Is it possible to make you write how to compile the different PHP-modules (such as MySQL, PDO, SQLite, etc...)? Or even get you to compile and package them (which would be awesome and make me willing to donate a minor fee)?
Hi Derick,
Did you finally build php-gtk2 for the Neo Freerunner compiled with pdo and sqlite extension?
Can you post some script or download link?
Thanx!
Bye
Life Line
It's PHP 8.5 release week !
I'm giving two talks on what's new in it, first on Wednesday evening in Leeds: https://www.meetup.com/leedsphp/events/311677834/
And then on Thursday evening in Rotterdam: https://eventy.io/events/q8lmw0v4Will I see you there?
@robinince Loving the new series of the Infinite Monkey Cage so far! #bbc
Updated a clothes shop and a restaurant; Deleted a dentist; Confirmed an estate_agent shop, a dentist, and 2 other objects
📷 Low Thames
🚩 Ranelagh Gardens, London Borough of Hammersmith and Fulham, United Kingdom
Updated a cafe
Created 2 gates; Updated a gate
Updated a restaurant
Updated a restaurant; Confirmed a cafe
📷 Shiny Translucent Mushroom
🚩 De Steeg, Nederland
I walked 1.7km in 18m14s
My personal domain name needs renewal. Gandi is charging £27 for this. I'll be moving it to @beasts, which charge £11, and actively reply to my silly questions here on Mastodon.
I walked 6.9km in 1h9m01s
📷 Public Footpath/Bridleway
🚩 West Parkside, Chelsham, United Kingdom
Update shops and extend of Londis on Harrow Road (and realign some odd alignments of buildings)
Created an interior_decoration shop, an entrance, and an alcohol shop; Updated a caterer, an architect office, and 3 other objects; Confirmed a bakery shop, a gallery, and 2 other objects
I walked 7.2km in 1h33m59s
I walked 1.2km in 10m20s
My union UTAW (with others) is hosting a session with @pluralistic on enshittification of the Internet next week: https://tuccampaigns.typeform.com/to/cWeW7uQ2?typeform-source=tech.unions.org.uk
It has an open registration.
You should still join a union: https://utaw.tech/
📷 Avenue Gardens
🚩 Princess Road, London, United Kingdom






Shortlink
This article has a short URL available: https://drck.me/php-oo-6g5