PHP and Lighttpd for Android
来源:互联网 发布:淘宝花呗分期怎么开通 编辑:程序博客网 时间:2024/05/20 20:03
Update 7 May 2012: New version released, containing PHP 5.4.2 version (CGI only). It now contains openssl / curl / SQLite modules statically linked within php-cgi executable and thus curlssl works! Beside the version number, all installation instructions below still apply.
If you are already using PHP 5.3.8, just grab the php-cgi file from the 5.4.2 archive system/xbin folder and replace the /system/xbin/php-cgi on the device.
Introduction
Below you can find an bundle of PHP 5.3.8 (CGI only) and Lighttpd 1.4.29 (FastCGI module included) which are cross compiled for ARMv5 CPUs (Android platforms mainly).
As you mail well know, both PHP and Lighttpd offer modules that could be loaded at run-time based on settings within configuration files. The bundle doesn’t include all modules, due to difficulties encountered when compiling for ARM platforms. Those modules that are included are statically linked in the executables (so no additional files are needed) nor configuration files need to be updated to load them.
Screenshots
Below you can see screenshots with the phone browser opening localhost address. Once you unpack the archive, there’s an index.php file which just calls phpinfo() to show the details about the build.
Of course, you can remove the file and put your own scripts
PHP Modules
The list of PHP modules that are statically linked:
Lighttpd Modules
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
License
Please check README.txt file found in /system/README.txt within the bundle.
PHP executable is offered under PHP license, Lighttpd executable under Lighttpd license, all other files in the bundle are offered under New BSD License (3 clause BSD license).
Installing
The bundle tries to mimic as much as possible the layout of a Debian installation of the two files. However, due to file system layout on Android phones (binaries under /system folder), the folders are one step down, under /system folder:
Prerequisites:
- rooted phone with busybox installed.
- mount the /system partition as RW.
Using DroidSSHd on the phone and connecting with Putty (or equivalent) makes the whole process faster.
After you copy the archive above into the root of your SD Card, installation is easy:
You might notice that the owner / group of the files is 1000:1000. Ignore that, as long as you execute them as root, there’s no issue (those are the IDs of my username on the PC I created the tar.gz archive and tar tries to conserve the user / creation time / etc from when the archive was created).
The last two commands start the FCGI server (PHP with 4 children processes), and then launch lighttpd server as daemon.
The default port is 80.
Default htdocs folder is /system/var/www.
The configuration files are under /system/etc/lighttpd/lighttpd.conf and /system/etc/php/php.ini. To restart either PHP or Lighttpd, please use one of the commands above.
It is mandatory that you are on the root folder when you extract the archive. tar will take care of creating all the missing folders, creating the links, etc, as long as you are on the root folder.
You can now open the phone’s browser and point it at localhost and the phpinfo() page should appear.
Example usage
Installing Simple Machines Forum 2.0.1 on Android
Before executing the commands below, you need the “Full Install” smf_2-0-1_install.tar.gz archive downloaded from SMF and then copied onto your /sdcard root folder.
Last two commands are optional, if you already started the FastCGI server as well as lighttpd.
You should now connect to http://localhost/forum and finish installation of the forum.
Enjoy
上一篇:PHP + Lighttpd for Android
下一篇:Porting PHP to Android——没有具体移植过程
- phpStudy 下载,PHP5开发环境...
- 为PHP添加GD库支持
- 灵芝的种类和图片
- yii2权限(RBAC)
- php生成二维码的几种方式...
- linux dhcp peizhi roc
- 关于Unix文件的软链接
- 求教这个命令什么意思,我是新...
- sed -e "/grep/d" 是什么意思...
- 谁能够帮我解决LINUX 2.6 10...
- PHP and Lighttpd for Android
- PHP + Lighttpd for Android
- lighttpd + php for android 安卓上的WEB服务器
- Android上安装lighttpd+php+mysql
- lighttpd+php
- lighttpd + php 很让人失望
- Lighttpd + PHP(fcgi)
- Lighttpd+PHP性能优化
- Lighttpd PHP fastcgi configuration
- lighttpd+PHP上传文件
- Lighttpd与PHP
- lighttpd+PHP安装
- Fedora8 安装lighttpd+PHP
- performance for php and zend
- lighttpd php Zend Optimizer安装
- linux (apache/lighttpd) php mysql
- CentOS下lighttpd+php安装
- lighttpd安装配置支持php
- 我为什么向后端工程师推荐Node.js
- 系统对话框
- LeetCode 203 Remove Linked List Elements
- PHP + Lighttpd for Android
- AnimationCurve
- PHP and Lighttpd for Android
- mvn Checkstyle使用
- Eclipse使用技巧 - 1. 自动添加getter和setter
- Porting PHP to Android——没有具体移植过程
- 零字节WSASend,WSARecv
- POJ 2948 DP
- php-5.5.1-android.patch.v3
- iOS学习笔记08--Objective-C反射
- java正则表达式(二)