1. 首先去官网下载一个php,现在我用的php版本是5.5.34.
1.1 编译php & 安装php
# tar -xvf php-5.5.34.tar.gz
# cd php-5.5.34
#CC=arm-hisiv200-linux-gcc ./configure --prefix=/user/php --disable-all --host=arm-linux --with-thttpd=/user/thttpd-2.21b
#make & make install
1.2 为什么需要--with-thttpd-2.21b呢?
原因是 thttpd需要关联到php,使之支持php
2. 编译thttpd-2.21b及安装
# CC=arm-hisiv200-linux-gcc ./configure --prefix=/user/thttpd --host=arm-linux
#make & make install
在make install 之前你需要做如下操作(thttpd-2.21b版本的安装脚本写的更软弱,所以需要手动添加):
# mkdir /user/thttpd/{man,sbin,www,etc,logs} -p
# mkdir /user/thttpd/man/ {man1,man8} -p
# mkdir /user/thttpd/www/cgi-bin -p
3. 创建配置文件
# cd /user/thttpd/etc/
# vi thttpd.conf
dir=/user/thttpd/home/httpd/html
user=root # default=nobody
charset = utf-8
logfile=/user/thttpd/var/log/thttpd.log
pidfile=/user/thttpd/var/run/thttpd.pid
cgipat=/user/thttpd/www/cgi-bin/*
4. 测试
当你做完这到这步的时候,执行下看下结果,不要怀疑自己的眼睛,你已经成功移植了
5. 参考案例:
http://www.veryarm.com/1306.html
http://blog.chinaunix.net/uid-22982394-id-147256.html